From 789d49359510f10c68be61eaa56d77b3ab428328 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 23 Oct 2013 18:34:06 +0200 Subject: [ticket/11912] Integrate mimetype guesser with plupload PHPBB3-11912 --- phpBB/phpbb/plupload/plupload.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/plupload/plupload.php b/phpBB/phpbb/plupload/plupload.php index 6eb5adf864..29a4aff39b 100644 --- a/phpBB/phpbb/plupload/plupload.php +++ b/phpBB/phpbb/plupload/plupload.php @@ -49,6 +49,11 @@ class plupload */ protected $php_ini; + /** + * @var \phpbb\mimetype\guesser + */ + protected $mimetype_guesser; + /** * Final destination for uploaded files, i.e. the "files" directory. * @var string @@ -69,16 +74,18 @@ class plupload * @param \phpbb\request\request_interface $request * @param \phpbb\user $user * @param \phpbb\php\ini $php_ini + * @param \phpbb\mimetype\guesser $mimetype_guesser * * @return null */ - public function __construct($phpbb_root_path, \phpbb\config\config $config, \phpbb\request\request_interface $request, \phpbb\user $user, \phpbb\php\ini $php_ini) + public function __construct($phpbb_root_path, \phpbb\config\config $config, \phpbb\request\request_interface $request, \phpbb\user $user, \phpbb\php\ini $php_ini, \phpbb\mimetype\guesser $mimetype_guesser) { $this->phpbb_root_path = $phpbb_root_path; $this->config = $config; $this->request = $request; $this->user = $user; $this->php_ini = $php_ini; + $this->mimetype_guesser = $mimetype_guesser; $this->upload_directory = $this->phpbb_root_path . $this->config['upload_path']; $this->temporary_directory = $this->upload_directory . '/plupload'; @@ -128,7 +135,7 @@ class plupload 'tmp_name' => $file_path, 'name' => $this->request->variable('real_filename', ''), 'size' => filesize($file_path), - 'type' => $file_info->getMimeType($file_path), + 'type' => $this->mimetype_guesser->guess($file_path), ); } else -- cgit v1.2.1 From 36d314e032757fc8d86f8f0daddc596e0e95ca8e Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 23 Oct 2013 18:34:35 +0200 Subject: [ticket/11912] Add phpbb mimetype guesser Mimetype guesser will be used as front-end file for mimetype guessing. PHPBB3-11912 --- phpBB/phpbb/mimetype/guesser.php | 105 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 phpBB/phpbb/mimetype/guesser.php (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/mimetype/guesser.php b/phpBB/phpbb/mimetype/guesser.php new file mode 100644 index 0000000000..5ae094cd63 --- /dev/null +++ b/phpBB/phpbb/mimetype/guesser.php @@ -0,0 +1,105 @@ +register_guessers($mimetype_guessers); + } + + /** + * Register MimeTypeGuessers + * + * @param array $mimetype_guessers Mimetype guesser service collection + * + * @throws \LogicException If incorrect or not mimetype guessers have + * been supplied to class + */ + protected function register_guessers($mimetype_guessers) + { + foreach ($mimetype_guessers as $guesser) + { + $is_supported = (method_exists($guesser, 'is_supported')) ? 'is_supported' : ''; + $is_supported = (method_exists($guesser, 'isSupported')) ? 'isSupported' : $is_supported; + + if (empty($is_supported)) + { + throw new \LogicException('Incorrect mimetype guesser supplied.'); + } + + if ($guesser->$is_supported()) + { + $this->guessers[] = $guesser; + } + } + + if (empty($this->guessers)) + { + throw new \LogicException('No mimetype guesser supplied.'); + } + } + + /** + * Guess mimetype of supplied file + * + * @param string $file Path to file + * + * @return string Guess for mimetype of file + */ + public function guess($file) + { + if (!is_file($file)) + { + return false; + } + + if (!is_readable($file)) + { + return false; + } + + foreach ($this->guessers as $guesser) + { + $mimetype = $guesser->guess($file); + + // Try to guess something that is not the fallback application/octet-stream + if ($mimetype !== null && $mimetype !== 'application/octet-stream') + { + return $mimetype; + } + } + // Return any mimetype if we got a result or the fallback value + return (!empty($mimetype)) ? $mimetype : 'application/octet-stream'; + } +} -- cgit v1.2.1 From 63945f3687f57fc341c6c28c7b8940805efa99b7 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 23 Oct 2013 23:11:33 +0200 Subject: [ticket/11912] Add content_guesser The content_guesser will try to use the function mime_content_type() if it's available. If that is not the case, the content_guesser will try to guess the mimetype using the file extension of the supplied file. Since this guesser will be registered after the other guessers, it will be only used if the other guessers are not available. PHPBB3-11912 --- phpBB/phpbb/mimetype/content_guesser.php | 548 +++++++++++++++++++++++++++++++ 1 file changed, 548 insertions(+) create mode 100644 phpBB/phpbb/mimetype/content_guesser.php (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/mimetype/content_guesser.php b/phpBB/phpbb/mimetype/content_guesser.php new file mode 100644 index 0000000000..4eeac75499 --- /dev/null +++ b/phpBB/phpbb/mimetype/content_guesser.php @@ -0,0 +1,548 @@ + 'x-world/x-3dmf', + '3dmf' => 'x-world/x-3dmf', + 'a' => 'application/octet-stream', + 'aab' => 'application/x-authorware-bin', + 'aam' => 'application/x-authorware-map', + 'aas' => 'application/x-authorware-seg', + 'abc' => 'text/vnd.abc', + 'acgi' => 'text/html', + 'afl' => 'video/animaflex', + 'ai' => 'application/postscript', + 'aif' => 'audio/aiff', + 'aifc' => 'audio/aiff', + 'aiff' => 'audio/aiff', + 'aim' => 'application/x-aim', + 'aip' => 'text/x-audiosoft-intra', + 'ani' => 'application/x-navi-animation', + 'aos' => 'application/x-nokia-9000-communicator-add-on-software', + 'aps' => 'application/mime', + 'arc' => 'application/octet-stream', + 'arj' => 'application/arj', + 'art' => 'image/x-jg', + 'asf' => 'video/x-ms-asf', + 'asm' => 'text/x-asm', + 'asp' => 'text/asp', + 'asx' => 'application/x-mplayer2', + 'au' => 'audio/basic', + 'avi' => 'application/x-troff-msvideo', + 'avs' => 'video/avs-video', + 'bcpio' => 'application/x-bcpio', + 'bin' => 'application/mac-binary', + 'bm' => 'image/bmp', + 'bmp' => 'image/bmp', + 'boo' => 'application/book', + 'book' => 'application/book', + 'boz' => 'application/x-bzip2', + 'bsh' => 'application/x-bsh', + 'bz' => 'application/x-bzip', + 'bz2' => 'application/x-bzip2', + 'c' => 'text/plain', + 'c++' => 'text/plain', + 'cat' => 'application/vnd.ms-pki.seccat', + 'cc' => 'text/plain', + 'ccad' => 'application/clariscad', + 'cco' => 'application/x-cocoa', + 'cdf' => 'application/cdf', + 'cer' => 'application/pkix-cert', + 'cha' => 'application/x-chat', + 'chat' => 'application/x-chat', + 'class' => 'application/java', + 'com' => 'application/octet-stream', + 'conf' => 'text/plain', + 'cpio' => 'application/x-cpio', + 'cpp' => 'text/x-c', + 'cpt' => 'application/mac-compactpro', + 'crl' => 'application/pkcs-crl', + 'crt' => 'application/pkix-cert', + 'csh' => 'application/x-csh', + 'css' => 'application/x-pointplus', + 'cxx' => 'text/plain', + 'dcr' => 'application/x-director', + 'deepv' => 'application/x-deepv', + 'def' => 'text/plain', + 'der' => 'application/x-x509-ca-cert', + 'dif' => 'video/x-dv', + 'dir' => 'application/x-director', + 'dl' => 'video/dl', + 'doc' => 'application/msword', + 'dot' => 'application/msword', + 'dp' => 'application/commonground', + 'drw' => 'application/drafting', + 'dump' => 'application/octet-stream', + 'dv' => 'video/x-dv', + 'dvi' => 'application/x-dvi', + 'dwf' => 'drawing/x-dwf (old)', + 'dwg' => 'application/acad', + 'dxf' => 'application/dxf', + 'dxr' => 'application/x-director', + 'el' => 'text/x-script.elisp', + 'elc' => 'application/x-bytecode.elisp (compiled elisp)', + 'env' => 'application/x-envoy', + 'eps' => 'application/postscript', + 'es' => 'application/x-esrehber', + 'etx' => 'text/x-setext', + 'evy' => 'application/envoy', + 'exe' => 'application/octet-stream', + 'f' => 'text/plain', + 'f77' => 'text/x-fortran', + 'f90' => 'text/plain', + 'fdf' => 'application/vnd.fdf', + 'fif' => 'application/fractals', + 'fli' => 'video/fli', + 'flo' => 'image/florian', + 'flx' => 'text/vnd.fmi.flexstor', + 'fmf' => 'video/x-atomic3d-feature', + 'for' => 'text/plain', + 'fpx' => 'image/vnd.fpx', + 'frl' => 'application/freeloader', + 'funk' => 'audio/make', + 'g' => 'text/plain', + 'g3' => 'image/g3fax', + 'gif' => 'image/gif', + 'gl' => 'video/gl', + 'gsd' => 'audio/x-gsm', + 'gsm' => 'audio/x-gsm', + 'gsp' => 'application/x-gsp', + 'gss' => 'application/x-gss', + 'gtar' => 'application/x-gtar', + 'gz' => 'application/x-compressed', + 'gzip' => 'application/x-gzip', + 'h' => 'text/plain', + 'hdf' => 'application/x-hdf', + 'help' => 'application/x-helpfile', + 'hgl' => 'application/vnd.hp-hpgl', + 'hh' => 'text/plain', + 'hlb' => 'text/x-script', + 'hlp' => 'application/hlp', + 'hpg' => 'application/vnd.hp-hpgl', + 'hpgl' => 'application/vnd.hp-hpgl', + 'hqx' => 'application/binhex', + 'hta' => 'application/hta', + 'htc' => 'text/x-component', + 'htm' => 'text/html', + 'html' => 'text/html', + 'htmls' => 'text/html', + 'htt' => 'text/webviewhtml', + 'htx' => 'text/html', + 'ice' => 'x-conference/x-cooltalk', + 'ico' => 'image/x-icon', + 'idc' => 'text/plain', + 'ief' => 'image/ief', + 'iefs' => 'image/ief', + 'iges' => 'application/iges', + 'igs' => 'application/iges', + 'ima' => 'application/x-ima', + 'imap' => 'application/x-httpd-imap', + 'inf' => 'application/inf', + 'ins' => 'application/x-internett-signup', + 'ip' => 'application/x-ip2', + 'isu' => 'video/x-isvideo', + 'it' => 'audio/it', + 'iv' => 'application/x-inventor', + 'ivr' => 'i-world/i-vrml', + 'ivy' => 'application/x-livescreen', + 'jam' => 'audio/x-jam', + 'jav' => 'text/plain', + 'java' => 'text/plain', + 'jcm' => 'application/x-java-commerce', + 'jfif' => 'image/jpeg', + 'jfif-tbnl' => 'image/jpeg', + 'jpe' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'jpg' => 'image/jpeg', + 'jps' => 'image/x-jps', + 'js' => 'application/x-javascript', + 'jut' => 'image/jutvision', + 'kar' => 'audio/midi', + 'ksh' => 'application/x-ksh', + 'la' => 'audio/nspaudio', + 'lam' => 'audio/x-liveaudio', + 'latex' => 'application/x-latex', + 'lha' => 'application/lha', + 'lhx' => 'application/octet-stream', + 'list' => 'text/plain', + 'lma' => 'audio/nspaudio', + 'log' => 'text/plain', + 'lsp' => 'application/x-lisp', + 'lst' => 'text/plain', + 'lsx' => 'text/x-la-asf', + 'ltx' => 'application/x-latex', + 'lzh' => 'application/octet-stream', + 'lzx' => 'application/lzx', + 'm' => 'text/plain', + 'm1v' => 'video/mpeg', + 'm2a' => 'audio/mpeg', + 'm2v' => 'video/mpeg', + 'm3u' => 'audio/x-mpequrl', + 'man' => 'application/x-troff-man', + 'map' => 'application/x-navimap', + 'mar' => 'text/plain', + 'mbd' => 'application/mbedlet', + 'mc$' => 'application/x-magic-cap-package-1.0', + 'mcd' => 'application/mcad', + 'mcf' => 'image/vasa', + 'mcp' => 'application/netmc', + 'me' => 'application/x-troff-me', + 'mht' => 'message/rfc822', + 'mhtml' => 'message/rfc822', + 'mid' => 'application/x-midi', + 'midi' => 'application/x-midi', + 'mif' => 'application/x-frame', + 'mime' => 'message/rfc822', + 'mjf' => 'audio/x-vnd.audioexplosion.mjuicemediafile', + 'mjpg' => 'video/x-motion-jpeg', + 'mm' => 'application/base64', + 'mme' => 'application/base64', + 'mod' => 'audio/mod', + 'moov' => 'video/quicktime', + 'mov' => 'video/quicktime', + 'movie' => 'video/x-sgi-movie', + 'mp2' => 'audio/mpeg', + 'mp3' => 'audio/mpeg3', + 'mpa' => 'audio/mpeg', + 'mpc' => 'application/x-project', + 'mpe' => 'video/mpeg', + 'mpeg' => 'video/mpeg', + 'mpg' => 'audio/mpeg', + 'mpga' => 'audio/mpeg', + 'mpp' => 'application/vnd.ms-project', + 'mpt' => 'application/x-project', + 'mpv' => 'application/x-project', + 'mpx' => 'application/x-project', + 'mrc' => 'application/marc', + 'ms' => 'application/x-troff-ms', + 'mv' => 'video/x-sgi-movie', + 'my' => 'audio/make', + 'mzz' => 'application/x-vnd.audioexplosion.mzz', + 'nap' => 'image/naplps', + 'naplps' => 'image/naplps', + 'nc' => 'application/x-netcdf', + 'ncm' => 'application/vnd.nokia.configuration-message', + 'nif' => 'image/x-niff', + 'niff' => 'image/x-niff', + 'nix' => 'application/x-mix-transfer', + 'nsc' => 'application/x-conference', + 'nvd' => 'application/x-navidoc', + 'o' => 'application/octet-stream', + 'oda' => 'application/oda', + 'omc' => 'application/x-omc', + 'omcd' => 'application/x-omcdatamaker', + 'omcr' => 'application/x-omcregerator', + 'p' => 'text/x-pascal', + 'p10' => 'application/pkcs10', + 'p12' => 'application/pkcs-12', + 'p7a' => 'application/x-pkcs7-signature', + 'p7c' => 'application/pkcs7-mime', + 'p7m' => 'application/pkcs7-mime', + 'p7r' => 'application/x-pkcs7-certreqresp', + 'p7s' => 'application/pkcs7-signature', + 'part' => 'application/pro_eng', + 'pas' => 'text/pascal', + 'pbm' => 'image/x-portable-bitmap', + 'pcl' => 'application/vnd.hp-pcl', + 'pct' => 'image/x-pict', + 'pcx' => 'image/x-pcx', + 'pdb' => 'chemical/x-pdb', + 'pdf' => 'application/pdf', + 'pfunk' => 'audio/make', + 'pgm' => 'image/x-portable-graymap', + 'pic' => 'image/pict', + 'pict' => 'image/pict', + 'pkg' => 'application/x-newton-compatible-pkg', + 'pko' => 'application/vnd.ms-pki.pko', + 'pl' => 'text/plain', + 'plx' => 'application/x-pixclscript', + 'pm' => 'image/x-xpixmap', + 'pm4' => 'application/x-pagemaker', + 'pm5' => 'application/x-pagemaker', + 'png' => 'image/png', + 'pnm' => 'application/x-portable-anymap', + 'pot' => 'application/mspowerpoint', + 'pov' => 'model/x-pov', + 'ppa' => 'application/vnd.ms-powerpoint', + 'ppm' => 'image/x-portable-pixmap', + 'pps' => 'application/mspowerpoint', + 'ppt' => 'application/mspowerpoint', + 'ppz' => 'application/mspowerpoint', + 'pre' => 'application/x-freelance', + 'prt' => 'application/pro_eng', + 'ps' => 'application/postscript', + 'psd' => 'application/octet-stream', + 'pvu' => 'paleovu/x-pv', + 'pwz' => 'application/vnd.ms-powerpoint', + 'py' => 'text/x-script.phyton', + 'pyc' => 'applicaiton/x-bytecode.python', + 'qcp' => 'audio/vnd.qcelp', + 'qd3' => 'x-world/x-3dmf', + 'qd3d' => 'x-world/x-3dmf', + 'qif' => 'image/x-quicktime', + 'qt' => 'video/quicktime', + 'qtc' => 'video/x-qtc', + 'qti' => 'image/x-quicktime', + 'qtif' => 'image/x-quicktime', + 'ra' => 'audio/x-pn-realaudio', + 'ram' => 'audio/x-pn-realaudio', + 'ras' => 'application/x-cmu-raster', + 'rast' => 'image/cmu-raster', + 'rexx' => 'text/x-script.rexx', + 'rf' => 'image/vnd.rn-realflash', + 'rgb' => 'image/x-rgb', + 'rm' => 'application/vnd.rn-realmedia', + 'rmi' => 'audio/mid', + 'rmm' => 'audio/x-pn-realaudio', + 'rmp' => 'audio/x-pn-realaudio', + 'rng' => 'application/ringing-tones', + 'rnx' => 'application/vnd.rn-realplayer', + 'roff' => 'application/x-troff', + 'rp' => 'image/vnd.rn-realpix', + 'rpm' => 'audio/x-pn-realaudio-plugin', + 'rt' => 'text/richtext', + 'rtf' => 'application/rtf', + 'rtx' => 'application/rtf', + 'rv' => 'video/vnd.rn-realvideo', + 's' => 'text/x-asm', + 's3m' => 'audio/s3m', + 'saveme' => 'application/octet-stream', + 'sbk' => 'application/x-tbook', + 'scm' => 'application/x-lotusscreencam', + 'sdml' => 'text/plain', + 'sdp' => 'application/sdp', + 'sdr' => 'application/sounder', + 'sea' => 'application/sea', + 'set' => 'application/set', + 'sgm' => 'text/sgml', + 'sgml' => 'text/sgml', + 'sh' => 'application/x-bsh', + 'shar' => 'application/x-bsh', + 'shtml' => 'text/html', + 'sid' => 'audio/x-psid', + 'sit' => 'application/x-sit', + 'skd' => 'application/x-koan', + 'skm' => 'application/x-koan', + 'skp' => 'application/x-koan', + 'skt' => 'application/x-koan', + 'sl' => 'application/x-seelogo', + 'smi' => 'application/smil', + 'smil' => 'application/smil', + 'snd' => 'audio/basic', + 'sol' => 'application/solids', + 'spc' => 'application/x-pkcs7-certificates', + 'spl' => 'application/futuresplash', + 'spr' => 'application/x-sprite', + 'sprite' => 'application/x-sprite', + 'src' => 'application/x-wais-source', + 'ssi' => 'text/x-server-parsed-html', + 'ssm' => 'application/streamingmedia', + 'sst' => 'application/vnd.ms-pki.certstore', + 'step' => 'application/step', + 'stl' => 'application/sla', + 'stp' => 'application/step', + 'sv4cpio' => 'application/x-sv4cpio', + 'sv4crc' => 'application/x-sv4crc', + 'svf' => 'image/vnd.dwg', + 'svr' => 'application/x-world', + 'swf' => 'application/x-shockwave-flash', + 't' => 'application/x-troff', + 'talk' => 'text/x-speech', + 'tar' => 'application/x-tar', + 'tbk' => 'application/toolbook', + 'tcl' => 'application/x-tcl', + 'tcsh' => 'text/x-script.tcsh', + 'tex' => 'application/x-tex', + 'texi' => 'application/x-texinfo', + 'texinfo' => 'application/x-texinfo', + 'text' => 'application/plain', + 'tgz' => 'application/gnutar', + 'tif' => 'image/tiff', + 'tiff' => 'image/tiff', + 'tr' => 'application/x-troff', + 'tsi' => 'audio/tsp-audio', + 'tsp' => 'application/dsptype', + 'tsv' => 'text/tab-separated-values', + 'turbot' => 'image/florian', + 'txt' => 'text/plain', + 'uil' => 'text/x-uil', + 'uni' => 'text/uri-list', + 'unis' => 'text/uri-list', + 'unv' => 'application/i-deas', + 'uri' => 'text/uri-list', + 'uris' => 'text/uri-list', + 'ustar' => 'application/x-ustar', + 'uu' => 'application/octet-stream', + 'uue' => 'text/x-uuencode', + 'vcd' => 'application/x-cdlink', + 'vcs' => 'text/x-vcalendar', + 'vda' => 'application/vda', + 'vdo' => 'video/vdo', + 'vew' => 'application/groupwise', + 'viv' => 'video/vivo', + 'vivo' => 'video/vivo', + 'vmd' => 'application/vocaltec-media-desc', + 'vmf' => 'application/vocaltec-media-file', + 'voc' => 'audio/voc', + 'vos' => 'video/vosaic', + 'vox' => 'audio/voxware', + 'vqe' => 'audio/x-twinvq-plugin', + 'vqf' => 'audio/x-twinvq', + 'vql' => 'audio/x-twinvq-plugin', + 'vrml' => 'application/x-vrml', + 'vrt' => 'x-world/x-vrt', + 'vsd' => 'application/x-visio', + 'vst' => 'application/x-visio', + 'vsw' => 'application/x-visio', + 'w60' => 'application/wordperfect6.0', + 'w61' => 'application/wordperfect6.1', + 'w6w' => 'application/msword', + 'wav' => 'audio/wav', + 'wb1' => 'application/x-qpro', + 'wbmp' => 'image/vnd.wap.wbmp', + 'web' => 'application/vnd.xara', + 'wiz' => 'application/msword', + 'wk1' => 'application/x-123', + 'wmf' => 'windows/metafile', + 'wml' => 'text/vnd.wap.wml', + 'wmlc' => 'application/vnd.wap.wmlc', + 'wmls' => 'text/vnd.wap.wmlscript', + 'wmlsc' => 'application/vnd.wap.wmlscriptc', + 'word' => 'application/msword', + 'wp' => 'application/wordperfect', + 'wp5' => 'application/wordperfect', + 'wp6' => 'application/wordperfect', + 'wpd' => 'application/wordperfect', + 'wq1' => 'application/x-lotus', + 'wri' => 'application/mswrite', + 'wrl' => 'application/x-world', + 'wrz' => 'model/vrml', + 'wsc' => 'text/scriplet', + 'wsrc' => 'application/x-wais-source', + 'wtk' => 'application/x-wintalk', + 'xbm' => 'image/x-xbitmap', + 'xdr' => 'video/x-amt-demorun', + 'xgz' => 'xgl/drawing', + 'xif' => 'image/vnd.xiff', + 'xl' => 'application/excel', + 'xla' => 'application/excel', + 'xlb' => 'application/excel', + 'xlc' => 'application/excel', + 'xld' => 'application/excel', + 'xlk' => 'application/excel', + 'xll' => 'application/excel', + 'xlm' => 'application/excel', + 'xls' => 'application/excel', + 'xlt' => 'application/excel', + 'xlv' => 'application/excel', + 'xlw' => 'application/excel', + 'xm' => 'audio/xm', + 'xml' => 'application/xml', + 'xmz' => 'xgl/movie', + 'xpix' => 'application/x-vnd.ls-xpix', + 'xpm' => 'image/x-xpixmap', + 'x-png' => 'image/png', + 'xsr' => 'video/x-amt-showrun', + 'xwd' => 'image/x-xwd', + 'xyz' => 'chemical/x-pdb', + 'z' => 'application/x-compress', + 'zip' => 'application/x-compressed', + 'zoo' => 'application/octet-stream', + 'zsh' => 'text/x-script.zsh', + ); + + /** + * @const mime_magic_file + */ + const mime_magic_file = 'phpbb/mimetype/fixture/magic.mgc'; + + /** + * Construct a content_guesser object + * + * @param string $phpbb_root_path phpBB root path + * @param \phpbb\php\ini $php_ini + */ + public function __construct($phpbb_root_path, \phpbb\php\ini $php_ini) + { + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ini = $php_ini; + } + + /** + * + */ + public function is_supported() + { + return true; + } + + /** + * Guess mimetype of supplied file + * + * @param string $file Path to file + * + * @return string Guess for mimetype of file + */ + public function guess($file) + { + $mimetype = null; + if (function_exists('mime_content_type')) + { + $mimetype = mime_content_type($file); + } + else + { + $mimetype = $this->map_extension_to_type($file); + } + return $mimetype; + } + + protected function map_extension_to_type($file) + { + $extension = pathinfo($file, PATHINFO_EXTENSION); + + if (isset($this->extension_map[$extension])) + { + return $this->extension_map[$extension]; + } + else + { + return null; + } + } +} -- cgit v1.2.1 From 4af6270d0fb90a918841d63186497888ffb92bbb Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 24 Oct 2013 11:28:49 +0200 Subject: [ticket/11912] Improve extension map in content_guesser PHPBB3-11912 --- phpBB/phpbb/mimetype/content_guesser.php | 181 ++++++++++++++++--------------- 1 file changed, 91 insertions(+), 90 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/mimetype/content_guesser.php b/phpBB/phpbb/mimetype/content_guesser.php index 4eeac75499..e6554666fc 100644 --- a/phpBB/phpbb/mimetype/content_guesser.php +++ b/phpBB/phpbb/mimetype/content_guesser.php @@ -61,12 +61,12 @@ class content_guesser 'asf' => 'video/x-ms-asf', 'asm' => 'text/x-asm', 'asp' => 'text/asp', - 'asx' => 'application/x-mplayer2', - 'au' => 'audio/basic', - 'avi' => 'application/x-troff-msvideo', + 'asx' => 'video/x-ms-asf', + 'au' => 'audio/x-au', + 'avi' => 'video/avi', 'avs' => 'video/avs-video', 'bcpio' => 'application/x-bcpio', - 'bin' => 'application/mac-binary', + 'bin' => 'application/x-binary', 'bm' => 'image/bmp', 'bmp' => 'image/bmp', 'boo' => 'application/book', @@ -75,14 +75,14 @@ class content_guesser 'bsh' => 'application/x-bsh', 'bz' => 'application/x-bzip', 'bz2' => 'application/x-bzip2', - 'c' => 'text/plain', - 'c++' => 'text/plain', + 'c' => 'text/x-c', + 'c++' => 'text/x-c', 'cat' => 'application/vnd.ms-pki.seccat', 'cc' => 'text/plain', 'ccad' => 'application/clariscad', 'cco' => 'application/x-cocoa', 'cdf' => 'application/cdf', - 'cer' => 'application/pkix-cert', + 'cer' => 'application/x-x509-ca-cert', 'cha' => 'application/x-chat', 'chat' => 'application/x-chat', 'class' => 'application/java', @@ -90,11 +90,11 @@ class content_guesser 'conf' => 'text/plain', 'cpio' => 'application/x-cpio', 'cpp' => 'text/x-c', - 'cpt' => 'application/mac-compactpro', - 'crl' => 'application/pkcs-crl', - 'crt' => 'application/pkix-cert', + 'cpt' => 'application/x-cpt', + 'crl' => 'application/pkix-crl', + 'crt' => 'application/x-x509-ca-cert', 'csh' => 'application/x-csh', - 'css' => 'application/x-pointplus', + 'css' => 'text/css', 'cxx' => 'text/plain', 'dcr' => 'application/x-director', 'deepv' => 'application/x-deepv', @@ -110,52 +110,52 @@ class content_guesser 'dump' => 'application/octet-stream', 'dv' => 'video/x-dv', 'dvi' => 'application/x-dvi', - 'dwf' => 'drawing/x-dwf (old)', - 'dwg' => 'application/acad', - 'dxf' => 'application/dxf', + 'dwf' => 'model/vnd.dwf', + 'dwg' => 'image/x-dwg', + 'dxf' => 'image/x-dwg', 'dxr' => 'application/x-director', 'el' => 'text/x-script.elisp', - 'elc' => 'application/x-bytecode.elisp (compiled elisp)', + 'elc' => 'application/x-elc', 'env' => 'application/x-envoy', 'eps' => 'application/postscript', 'es' => 'application/x-esrehber', 'etx' => 'text/x-setext', - 'evy' => 'application/envoy', + 'evy' => 'application/x-envoy', 'exe' => 'application/octet-stream', - 'f' => 'text/plain', + 'f' => 'text/x-fortran', 'f77' => 'text/x-fortran', - 'f90' => 'text/plain', + 'f90' => 'text/x-fortran', 'fdf' => 'application/vnd.fdf', - 'fif' => 'application/fractals', - 'fli' => 'video/fli', + 'fif' => 'image/fif', + 'fli' => 'video/x-fli', 'flo' => 'image/florian', 'flx' => 'text/vnd.fmi.flexstor', 'fmf' => 'video/x-atomic3d-feature', - 'for' => 'text/plain', + 'for' => 'text/x-fortran', 'fpx' => 'image/vnd.fpx', 'frl' => 'application/freeloader', 'funk' => 'audio/make', 'g' => 'text/plain', 'g3' => 'image/g3fax', 'gif' => 'image/gif', - 'gl' => 'video/gl', + 'gl' => 'video/x-gl', 'gsd' => 'audio/x-gsm', 'gsm' => 'audio/x-gsm', 'gsp' => 'application/x-gsp', 'gss' => 'application/x-gss', 'gtar' => 'application/x-gtar', - 'gz' => 'application/x-compressed', + 'gz' => 'application/x-gzip', 'gzip' => 'application/x-gzip', - 'h' => 'text/plain', + 'h' => 'text/x-h', 'hdf' => 'application/x-hdf', 'help' => 'application/x-helpfile', 'hgl' => 'application/vnd.hp-hpgl', - 'hh' => 'text/plain', + 'hh' => 'text/x-h', 'hlb' => 'text/x-script', 'hlp' => 'application/hlp', 'hpg' => 'application/vnd.hp-hpgl', 'hpgl' => 'application/vnd.hp-hpgl', - 'hqx' => 'application/binhex', + 'hqx' => 'application/x-binhex40', 'hta' => 'application/hta', 'htc' => 'text/x-component', 'htm' => 'text/html', @@ -182,7 +182,8 @@ class content_guesser 'ivy' => 'application/x-livescreen', 'jam' => 'audio/x-jam', 'jav' => 'text/plain', - 'java' => 'text/plain', + 'jav' => 'text/x-java-source', + 'java' => 'text/x-java-source', 'jcm' => 'application/x-java-commerce', 'jfif' => 'image/jpeg', 'jfif-tbnl' => 'image/jpeg', @@ -193,22 +194,22 @@ class content_guesser 'js' => 'application/x-javascript', 'jut' => 'image/jutvision', 'kar' => 'audio/midi', - 'ksh' => 'application/x-ksh', - 'la' => 'audio/nspaudio', + 'ksh' => 'text/x-script.ksh', + 'la' => 'audio/x-nspaudio', 'lam' => 'audio/x-liveaudio', 'latex' => 'application/x-latex', - 'lha' => 'application/lha', + 'lha' => 'application/x-lha', 'lhx' => 'application/octet-stream', 'list' => 'text/plain', - 'lma' => 'audio/nspaudio', + 'lma' => 'audio/x-nspaudio', 'log' => 'text/plain', - 'lsp' => 'application/x-lisp', + 'lsp' => 'text/x-script.lisp', 'lst' => 'text/plain', 'lsx' => 'text/x-la-asf', 'ltx' => 'application/x-latex', - 'lzh' => 'application/octet-stream', - 'lzx' => 'application/lzx', - 'm' => 'text/plain', + 'lzh' => 'application/x-lzh', + 'lzx' => 'application/x-lzx', + 'm' => 'text/x-m', 'm1v' => 'video/mpeg', 'm2a' => 'audio/mpeg', 'm2v' => 'video/mpeg', @@ -218,31 +219,31 @@ class content_guesser 'mar' => 'text/plain', 'mbd' => 'application/mbedlet', 'mc$' => 'application/x-magic-cap-package-1.0', - 'mcd' => 'application/mcad', - 'mcf' => 'image/vasa', + 'mcd' => 'application/x-mathcad', + 'mcf' => 'text/mcf', 'mcp' => 'application/netmc', 'me' => 'application/x-troff-me', 'mht' => 'message/rfc822', 'mhtml' => 'message/rfc822', - 'mid' => 'application/x-midi', - 'midi' => 'application/x-midi', - 'mif' => 'application/x-frame', - 'mime' => 'message/rfc822', + 'mid' => 'audio/x-midi', + 'midi' => 'audio/x-midi', + 'mif' => 'application/x-mif', + 'mime' => 'www/mime', 'mjf' => 'audio/x-vnd.audioexplosion.mjuicemediafile', 'mjpg' => 'video/x-motion-jpeg', - 'mm' => 'application/base64', + 'mm' => 'application/x-meme', 'mme' => 'application/base64', - 'mod' => 'audio/mod', + 'mod' => 'audio/x-mod', 'moov' => 'video/quicktime', 'mov' => 'video/quicktime', 'movie' => 'video/x-sgi-movie', - 'mp2' => 'audio/mpeg', - 'mp3' => 'audio/mpeg3', + 'mp2' => 'audio/x-mpeg', + 'mp3' => 'audio/x-mpeg-3', 'mpa' => 'audio/mpeg', 'mpc' => 'application/x-project', 'mpe' => 'video/mpeg', 'mpeg' => 'video/mpeg', - 'mpg' => 'audio/mpeg', + 'mpg' => 'video/mpeg', 'mpga' => 'audio/mpeg', 'mpp' => 'application/vnd.ms-project', 'mpt' => 'application/x-project', @@ -268,34 +269,34 @@ class content_guesser 'omcd' => 'application/x-omcdatamaker', 'omcr' => 'application/x-omcregerator', 'p' => 'text/x-pascal', - 'p10' => 'application/pkcs10', - 'p12' => 'application/pkcs-12', + 'p10' => 'application/x-pkcs10', + 'p12' => 'application/x-pkcs12', 'p7a' => 'application/x-pkcs7-signature', - 'p7c' => 'application/pkcs7-mime', - 'p7m' => 'application/pkcs7-mime', + 'p7c' => 'application/x-pkcs7-mime', + 'p7m' => 'application/x-pkcs7-mime', 'p7r' => 'application/x-pkcs7-certreqresp', 'p7s' => 'application/pkcs7-signature', 'part' => 'application/pro_eng', 'pas' => 'text/pascal', 'pbm' => 'image/x-portable-bitmap', - 'pcl' => 'application/vnd.hp-pcl', + 'pcl' => 'application/x-pcl', 'pct' => 'image/x-pict', 'pcx' => 'image/x-pcx', 'pdb' => 'chemical/x-pdb', 'pdf' => 'application/pdf', - 'pfunk' => 'audio/make', - 'pgm' => 'image/x-portable-graymap', + 'pfunk' => 'audio/make.my.funk', + 'pgm' => 'image/x-portable-greymap', 'pic' => 'image/pict', 'pict' => 'image/pict', 'pkg' => 'application/x-newton-compatible-pkg', 'pko' => 'application/vnd.ms-pki.pko', - 'pl' => 'text/plain', + 'pl' => 'text/x-script.perl', 'plx' => 'application/x-pixclscript', - 'pm' => 'image/x-xpixmap', + 'pm' => 'text/x-script.perl-module', 'pm4' => 'application/x-pagemaker', 'pm5' => 'application/x-pagemaker', 'png' => 'image/png', - 'pnm' => 'application/x-portable-anymap', + 'pnm' => 'image/x-portable-anymap', 'pot' => 'application/mspowerpoint', 'pov' => 'model/x-pov', 'ppa' => 'application/vnd.ms-powerpoint', @@ -319,43 +320,43 @@ class content_guesser 'qtc' => 'video/x-qtc', 'qti' => 'image/x-quicktime', 'qtif' => 'image/x-quicktime', - 'ra' => 'audio/x-pn-realaudio', + 'ra' => 'audio/x-realaudio', 'ram' => 'audio/x-pn-realaudio', - 'ras' => 'application/x-cmu-raster', + 'ras' => 'image/x-cmu-raster', 'rast' => 'image/cmu-raster', 'rexx' => 'text/x-script.rexx', 'rf' => 'image/vnd.rn-realflash', 'rgb' => 'image/x-rgb', - 'rm' => 'application/vnd.rn-realmedia', + 'rm' => 'audio/x-pn-realaudio', 'rmi' => 'audio/mid', 'rmm' => 'audio/x-pn-realaudio', 'rmp' => 'audio/x-pn-realaudio', - 'rng' => 'application/ringing-tones', + 'rng' => 'application/vnd.nokia.ringing-tone', 'rnx' => 'application/vnd.rn-realplayer', 'roff' => 'application/x-troff', 'rp' => 'image/vnd.rn-realpix', 'rpm' => 'audio/x-pn-realaudio-plugin', 'rt' => 'text/richtext', - 'rtf' => 'application/rtf', - 'rtx' => 'application/rtf', + 'rtf' => 'text/richtext', + 'rtx' => 'text/richtext', 'rv' => 'video/vnd.rn-realvideo', 's' => 'text/x-asm', 's3m' => 'audio/s3m', 'saveme' => 'application/octet-stream', 'sbk' => 'application/x-tbook', - 'scm' => 'application/x-lotusscreencam', + 'scm' => 'video/x-scm', 'sdml' => 'text/plain', - 'sdp' => 'application/sdp', + 'sdp' => 'application/x-sdp', 'sdr' => 'application/sounder', - 'sea' => 'application/sea', + 'sea' => 'application/x-sea', 'set' => 'application/set', - 'sgm' => 'text/sgml', - 'sgml' => 'text/sgml', - 'sh' => 'application/x-bsh', - 'shar' => 'application/x-bsh', - 'shtml' => 'text/html', + 'sgm' => 'text/x-sgml', + 'sgml' => 'text/x-sgml', + 'sh' => 'text/x-script.sh', + 'shar' => 'application/x-shar', + 'shtml' => 'text/x-server-parsed-html', 'sid' => 'audio/x-psid', - 'sit' => 'application/x-sit', + 'sit' => 'application/x-stuffit', 'skd' => 'application/x-koan', 'skm' => 'application/x-koan', 'skp' => 'application/x-koan', @@ -363,9 +364,9 @@ class content_guesser 'sl' => 'application/x-seelogo', 'smi' => 'application/smil', 'smil' => 'application/smil', - 'snd' => 'audio/basic', + 'snd' => 'audio/x-adpcm', 'sol' => 'application/solids', - 'spc' => 'application/x-pkcs7-certificates', + 'spc' => 'text/x-speech', 'spl' => 'application/futuresplash', 'spr' => 'application/x-sprite', 'sprite' => 'application/x-sprite', @@ -374,29 +375,29 @@ class content_guesser 'ssm' => 'application/streamingmedia', 'sst' => 'application/vnd.ms-pki.certstore', 'step' => 'application/step', - 'stl' => 'application/sla', + 'stl' => 'application/vnd.ms-pki.stl', 'stp' => 'application/step', 'sv4cpio' => 'application/x-sv4cpio', 'sv4crc' => 'application/x-sv4crc', - 'svf' => 'image/vnd.dwg', + 'svf' => 'image/x-dwg', 'svr' => 'application/x-world', 'swf' => 'application/x-shockwave-flash', 't' => 'application/x-troff', 'talk' => 'text/x-speech', 'tar' => 'application/x-tar', - 'tbk' => 'application/toolbook', - 'tcl' => 'application/x-tcl', + 'tbk' => 'application/x-tbook', + 'tcl' => 'text/x-script.tcl', 'tcsh' => 'text/x-script.tcsh', 'tex' => 'application/x-tex', 'texi' => 'application/x-texinfo', 'texinfo' => 'application/x-texinfo', - 'text' => 'application/plain', - 'tgz' => 'application/gnutar', + 'text' => 'text/plain', + 'tgz' => 'application/x-compressed', 'tif' => 'image/tiff', 'tiff' => 'image/tiff', 'tr' => 'application/x-troff', 'tsi' => 'audio/tsp-audio', - 'tsp' => 'application/dsptype', + 'tsp' => 'audio/tsplayer', 'tsv' => 'text/tab-separated-values', 'turbot' => 'image/florian', 'txt' => 'text/plain', @@ -406,8 +407,8 @@ class content_guesser 'unv' => 'application/i-deas', 'uri' => 'text/uri-list', 'uris' => 'text/uri-list', - 'ustar' => 'application/x-ustar', - 'uu' => 'application/octet-stream', + 'ustar' => 'multipart/x-ustar', + 'uu' => 'text/x-uuencode', 'uue' => 'text/x-uuencode', 'vcd' => 'application/x-cdlink', 'vcs' => 'text/x-vcalendar', @@ -450,18 +451,18 @@ class content_guesser 'wpd' => 'application/wordperfect', 'wq1' => 'application/x-lotus', 'wri' => 'application/mswrite', - 'wrl' => 'application/x-world', + 'wrl' => 'model/vrml', 'wrz' => 'model/vrml', 'wsc' => 'text/scriplet', 'wsrc' => 'application/x-wais-source', 'wtk' => 'application/x-wintalk', - 'xbm' => 'image/x-xbitmap', + 'xbm' => 'image/xbm', 'xdr' => 'video/x-amt-demorun', 'xgz' => 'xgl/drawing', 'xif' => 'image/vnd.xiff', 'xl' => 'application/excel', 'xla' => 'application/excel', - 'xlb' => 'application/excel', + 'xlb' => 'application/excel',, 'xlc' => 'application/excel', 'xld' => 'application/excel', 'xlk' => 'application/excel', @@ -472,16 +473,16 @@ class content_guesser 'xlv' => 'application/excel', 'xlw' => 'application/excel', 'xm' => 'audio/xm', - 'xml' => 'application/xml', + 'xml' => 'text/xml', 'xmz' => 'xgl/movie', 'xpix' => 'application/x-vnd.ls-xpix', - 'xpm' => 'image/x-xpixmap', + 'xpm' => 'image/xpm', 'x-png' => 'image/png', 'xsr' => 'video/x-amt-showrun', - 'xwd' => 'image/x-xwd', + 'xwd' => 'image/x-xwindowdump', 'xyz' => 'chemical/x-pdb', - 'z' => 'application/x-compress', - 'zip' => 'application/x-compressed', + 'z' => 'application/x-compressed', + 'zip' => 'application/x-zip-compressed', 'zoo' => 'application/octet-stream', 'zsh' => 'text/x-script.zsh', ); -- cgit v1.2.1 From d607f1c927ed6fb54d6c46eb13b5bcd4133f8cfc Mon Sep 17 00:00:00 2001 From: Cesar G Date: Thu, 24 Oct 2013 02:37:20 -0700 Subject: [ticket/11746] Add "admin activation required" notification. PHPBB3-11746 --- .../notification/type/admin_activate_user.php | 174 +++++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 phpBB/phpbb/notification/type/admin_activate_user.php (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/notification/type/admin_activate_user.php b/phpBB/phpbb/notification/type/admin_activate_user.php new file mode 100644 index 0000000000..1231c0b75d --- /dev/null +++ b/phpBB/phpbb/notification/type/admin_activate_user.php @@ -0,0 +1,174 @@ + 'NOTIFICATION_TYPE_ADMIN_ACTIVATE_USER', + 'group' => 'NOTIFICATION_GROUP_ADMINISTRATION', + ); + + /** + * {@inheritdoc} + */ + public function is_available() + { + return ($this->auth->acl_get('a_user') && $this->config['require_activation'] == USER_ACTIVATION_ADMIN); + } + + /** + * {@inheritdoc} + */ + public static function get_item_id($user) + { + return (int) $user['user_id']; + } + + /** + * {@inheritdoc} + */ + public static function get_item_parent_id($post) + { + return 0; + } + + /** + * {@inheritdoc} + */ + public function find_users_for_notification($user, $options = array()) + { + $options = array_merge(array( + 'ignore_users' => array(), + ), $options); + + // Grab admins that have permission to administer users. + $admin_ary = $this->auth->acl_get_list(false, 'a_user', false); + $users = (!empty($admin_ary[0]['a_user'])) ? $admin_ary[0]['a_user'] : array(); + + // Grab founders + $sql = 'SELECT user_id + FROM ' . USERS_TABLE . ' + WHERE user_type = ' . USER_FOUNDER; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($sql)) + { + $users[] = (int) $row['user_id']; + } + $this->db->sql_freeresult($result); + + if (empty($users)) + { + return array(); + } + $users = array_unique($users); + + return $this->check_user_notification_options($users, $options); + } + + /** + * {@inheritdoc} + */ + public function get_avatar() + { + return $this->user_loader->get_avatar($this->item_id); + } + + /** + * {@inheritdoc} + */ + public function get_title() + { + $username = $this->user_loader->get_username($this->item_id, 'no_profile'); + + return $this->user->lang($this->language_key, $username); + } + + /** + * {@inheritdoc} + */ + public function get_email_template() + { + return 'admin_activate'; + } + + /** + * {@inheritdoc} + */ + public function get_email_template_variables() + { + $board_url = generate_board_url(); + $username = $this->user_loader->get_username($this->item_id, 'no_profile'); + + return array( + 'USERNAME' => htmlspecialchars_decode($username), + 'U_USER_DETAILS' => "{$board_url}/memberlist.{$this->php_ext}?mode=viewprofile&u={$this->item_id}", + 'U_ACTIVATE' => "{$board_url}/ucp.{$this->php_ext}?mode=activate&u={$this->item_id}&k={$this->get_data('user_actkey')}", + ); + } + + /** + * {@inheritdoc} + */ + public function get_url() + { + return append_sid($this->phpbb_root_path . 'memberlist.' . $this->php_ext, "mode=viewprofile&u={$this->item_id}"); + } + + /** + * {@inheritdoc} + */ + public function users_to_query() + { + return array($this->item_id); + } + + /** + * {@inheritdoc} + */ + public function create_insert_array($user, $pre_create_data) + { + $this->set_data('user_actkey', $user['user_actkey']); + $this->notification_time = $user['user_regdate']; + + return parent::create_insert_array($user, $pre_create_data); + } +} -- cgit v1.2.1 From 973682cb2ddba8022622bdccc870925ea6a7237c Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 24 Oct 2013 12:02:40 +0200 Subject: =?UTF-8?q?[=C5=A7icket/11912]=20Get=20rid=20of=20obsolete=20varia?= =?UTF-8?q?bles=20in=20content=5Fguesser?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PHPBB3-11912 --- phpBB/phpbb/mimetype/content_guesser.php | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/mimetype/content_guesser.php b/phpBB/phpbb/mimetype/content_guesser.php index e6554666fc..65c4703e2a 100644 --- a/phpBB/phpbb/mimetype/content_guesser.php +++ b/phpBB/phpbb/mimetype/content_guesser.php @@ -23,16 +23,6 @@ if (!defined('IN_PHPBB')) class content_guesser { - /** - * @var phpbb_root_path - */ - protected $phpbb_root_path; - - /** - * @var \phpbb\php\ini - */ - protected $php_ini; - /** * @var file extension map */ @@ -488,24 +478,7 @@ class content_guesser ); /** - * @const mime_magic_file - */ - const mime_magic_file = 'phpbb/mimetype/fixture/magic.mgc'; - - /** - * Construct a content_guesser object - * - * @param string $phpbb_root_path phpBB root path - * @param \phpbb\php\ini $php_ini - */ - public function __construct($phpbb_root_path, \phpbb\php\ini $php_ini) - { - $this->phpbb_root_path = $phpbb_root_path; - $this->php_ini = $php_ini; - } - - /** - * + * @inheritdoc */ public function is_supported() { -- cgit v1.2.1 From 24099583a32608c2350bdb10d018d6c8a0551e6c Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 24 Oct 2013 12:03:46 +0200 Subject: [ticket/11912] Remove typo in content_guesser PHPBB3-11912 --- phpBB/phpbb/mimetype/content_guesser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/mimetype/content_guesser.php b/phpBB/phpbb/mimetype/content_guesser.php index 65c4703e2a..6bdd410af4 100644 --- a/phpBB/phpbb/mimetype/content_guesser.php +++ b/phpBB/phpbb/mimetype/content_guesser.php @@ -452,7 +452,7 @@ class content_guesser 'xif' => 'image/vnd.xiff', 'xl' => 'application/excel', 'xla' => 'application/excel', - 'xlb' => 'application/excel',, + 'xlb' => 'application/excel', 'xlc' => 'application/excel', 'xld' => 'application/excel', 'xlk' => 'application/excel', -- cgit v1.2.1 From bc7ff47537bae4f6db9de781cf8ba3487e28a30b Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 24 Oct 2013 12:05:00 +0200 Subject: [ticket/11912] Supply filename to content_guesser for guessing on windows The filename of the files sent to the guesser by plupload do not contain the file extension. Therefore, it's impossible to guess the mimetype if only the content_guesser is available and the function mime_content_type() doesn't exist. By supplying the filename we can circumvent this issue. PHPBB3-11912 --- phpBB/phpbb/mimetype/content_guesser.php | 16 ++++++++++++---- phpBB/phpbb/mimetype/guesser.php | 4 ++-- phpBB/phpbb/plupload/plupload.php | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/mimetype/content_guesser.php b/phpBB/phpbb/mimetype/content_guesser.php index 6bdd410af4..6326bf73fa 100644 --- a/phpBB/phpbb/mimetype/content_guesser.php +++ b/phpBB/phpbb/mimetype/content_guesser.php @@ -492,7 +492,7 @@ class content_guesser * * @return string Guess for mimetype of file */ - public function guess($file) + public function guess($file, $file_name = '') { $mimetype = null; if (function_exists('mime_content_type')) @@ -501,14 +501,22 @@ class content_guesser } else { - $mimetype = $this->map_extension_to_type($file); + $file_name = (empty($file_name)) ? $file : $file_name; + $mimetype = $this->map_extension_to_type($file_name); } return $mimetype; } - protected function map_extension_to_type($file) + /** + * Map extension of supplied file_name to mime type + * + * @param string $file_name Path to file or filename + * + * @return string|null Mimetype if known or null if not + */ + protected function map_extension_to_type($file_name) { - $extension = pathinfo($file, PATHINFO_EXTENSION); + $extension = pathinfo($file_name, PATHINFO_EXTENSION); if (isset($this->extension_map[$extension])) { diff --git a/phpBB/phpbb/mimetype/guesser.php b/phpBB/phpbb/mimetype/guesser.php index 5ae094cd63..231b75f604 100644 --- a/phpBB/phpbb/mimetype/guesser.php +++ b/phpBB/phpbb/mimetype/guesser.php @@ -77,7 +77,7 @@ class guesser * * @return string Guess for mimetype of file */ - public function guess($file) + public function guess($file, $file_name = '') { if (!is_file($file)) { @@ -91,7 +91,7 @@ class guesser foreach ($this->guessers as $guesser) { - $mimetype = $guesser->guess($file); + $mimetype = $guesser->guess($file, $file_name); // Try to guess something that is not the fallback application/octet-stream if ($mimetype !== null && $mimetype !== 'application/octet-stream') diff --git a/phpBB/phpbb/plupload/plupload.php b/phpBB/phpbb/plupload/plupload.php index 29a4aff39b..dedc3cbcd4 100644 --- a/phpBB/phpbb/plupload/plupload.php +++ b/phpBB/phpbb/plupload/plupload.php @@ -135,7 +135,7 @@ class plupload 'tmp_name' => $file_path, 'name' => $this->request->variable('real_filename', ''), 'size' => filesize($file_path), - 'type' => $this->mimetype_guesser->guess($file_path), + 'type' => $this->mimetype_guesser->guess($file_path, $file_name), ); } else -- cgit v1.2.1 From d25ab02ef34c5e20deb278e4379a6a3a365a93a0 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 24 Oct 2013 12:07:26 +0200 Subject: [ticket/11912] Introduce guesser_interface This will contain proper documentation of the required methods if anyone would implement a newer guesser. PHPBB3-11912 --- phpBB/phpbb/mimetype/content_guesser.php | 8 ++---- phpBB/phpbb/mimetype/guesser_interface.php | 41 ++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 phpBB/phpbb/mimetype/guesser_interface.php (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/mimetype/content_guesser.php b/phpBB/phpbb/mimetype/content_guesser.php index 6326bf73fa..f5be9cd44b 100644 --- a/phpBB/phpbb/mimetype/content_guesser.php +++ b/phpBB/phpbb/mimetype/content_guesser.php @@ -21,7 +21,7 @@ if (!defined('IN_PHPBB')) * @package mimetype */ -class content_guesser +class content_guesser implements guesser_interface { /** * @var file extension map @@ -486,11 +486,7 @@ class content_guesser } /** - * Guess mimetype of supplied file - * - * @param string $file Path to file - * - * @return string Guess for mimetype of file + * @inheritdoc */ public function guess($file, $file_name = '') { diff --git a/phpBB/phpbb/mimetype/guesser_interface.php b/phpBB/phpbb/mimetype/guesser_interface.php new file mode 100644 index 0000000000..a9b238d7aa --- /dev/null +++ b/phpBB/phpbb/mimetype/guesser_interface.php @@ -0,0 +1,41 @@ + Date: Thu, 24 Oct 2013 13:55:23 +0200 Subject: [ticket/11525] Only remove group or user prefix from given avatar data Until now, the user data had both user_id and group_id keys in the avatar data. As both group_ and user_ prefixes were removed the group_id was collapsed onto the user_id and therefore all users in the same group had the same prefix for their uploaded avatars. This patch will make sure that the correct id is used depending on whether it's a group's or user's avatar data. PHPBB3-11525 --- phpBB/phpbb/avatar/manager.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/avatar/manager.php b/phpBB/phpbb/avatar/manager.php index c28380a401..f2bb1a5dbe 100644 --- a/phpBB/phpbb/avatar/manager.php +++ b/phpBB/phpbb/avatar/manager.php @@ -178,14 +178,15 @@ class manager } /** - * Strip out user_ and group_ prefixes from keys + * Strip out user_, group_, or other prefixes from array keys * * @param array $row User data or group data + * @param string $prefix Prefix of data keys * * @return array User data or group data with keys that have been * stripped from the preceding "user_" or "group_" */ - static public function clean_row($row) + static public function clean_row($row, $prefix = '') { // Upon creation of a user/group $row might be empty if (empty($row)) @@ -196,7 +197,7 @@ class manager $keys = array_keys($row); $values = array_values($row); - $keys = array_map(array('\phpbb\avatar\manager', 'strip_prefix'), $keys); + array_walk($keys, array('\phpbb\avatar\manager', 'strip_prefix'), $prefix); return array_combine($keys, $values); } @@ -205,11 +206,12 @@ class manager * Strip prepending user_ or group_ prefix from key * * @param string Array key - * @return string Key that has been stripped from its prefix + * @return void */ - static protected function strip_prefix($key) + static protected function strip_prefix(&$key, $null, $prefix) { - return preg_replace('#^(?:user_|group_)#', '', $key); + $regex = ($prefix !== '') ? "#^(?:{$prefix}_)#" : '#^(?:user_|group_)#'; + $key = preg_replace($regex, '', $key); } /** -- cgit v1.2.1 From 9b0b5481fe05b10a254861495280d04721e8d9d1 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 24 Oct 2013 21:03:06 +0200 Subject: [ticket/11534] Check remote avatar content type if possible This should make sure that error pages like 404 or 503 pages are not treated as remote avatar images. PHPBB3-11534 --- phpBB/phpbb/avatar/driver/remote.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/avatar/driver/remote.php b/phpBB/phpbb/avatar/driver/remote.php index 1aa638dfe5..a04c6879f3 100644 --- a/phpBB/phpbb/avatar/driver/remote.php +++ b/phpBB/phpbb/avatar/driver/remote.php @@ -125,6 +125,37 @@ class remote extends \phpbb\avatar\driver\driver $types = \fileupload::image_types(); $extension = strtolower(\filespec::get_extension($url)); + // Check if this is actually an image + if ($file_stream = @fopen($url, 'r')) + { + // Timeout after 1 second + stream_set_timeout($file_stream, 1); + $meta = stream_get_meta_data($file_stream); + foreach ($meta['wrapper_data'] as $header) + { + $header = preg_split('/ /', $header, 2); + if (strtr(strtolower(trim($header[0], ':')), '_', '-') === 'content-type') + { + if (strpos($header[1], 'image/') !== 0) + { + $error[] = 'AVATAR_URL_INVALID'; + fclose($file_stream); + return false; + } + else + { + fclose($file_stream); + break; + } + } + } + } + else + { + $error[] = 'AVATAR_URL_INVALID'; + return false; + } + if (!empty($image_data) && (!isset($types[$image_data[2]]) || !in_array($extension, $types[$image_data[2]]))) { if (!isset($types[$image_data[2]])) -- cgit v1.2.1 From b2f638b79359ee6df600ca940ffa2b1657235364 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 27 Oct 2013 09:52:09 +0100 Subject: [ticket/11857] Use passed service collection instead of container in manager The service collection that was already passed to the avatar manager should be used in the avatar manager method get_driver() instead of the container itself. PHPBB3-11857 --- phpBB/phpbb/avatar/manager.php | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/avatar/manager.php b/phpBB/phpbb/avatar/manager.php index c28380a401..7c26bce5ae 100644 --- a/phpBB/phpbb/avatar/manager.php +++ b/phpBB/phpbb/avatar/manager.php @@ -41,12 +41,6 @@ class manager */ protected $avatar_drivers; - /** - * Service container object - * @var object - */ - protected $container; - /** * Default avatar data row * @var array @@ -63,13 +57,27 @@ class manager * * @param \phpbb\config\config $config phpBB configuration * @param array $avatar_drivers Avatar drivers passed via the service container - * @param object $container Container object */ - public function __construct(\phpbb\config\config $config, $avatar_drivers, $container) + public function __construct(\phpbb\config\config $config, $avatar_drivers) { $this->config = $config; - $this->avatar_drivers = $avatar_drivers; - $this->container = $container; + $this->register_avatar_drivers($avatar_drivers); + } + + /** + * Register avatar drivers + * + * @param array $avatar_drivers Service collection of avatar drivers + */ + protected function register_avatar_drivers($avatar_drivers) + { + if (!empty($avatar_drivers)) + { + foreach ($avatar_drivers as $driver) + { + $this->avatar_drivers[$driver->get_name()] = $driver; + } + } } /** @@ -112,7 +120,7 @@ class manager * There is no need to handle invalid avatar types as the following code * will cause a ServiceNotFoundException if the type does not exist */ - $driver = $this->container->get($avatar_type); + $driver = $this->avatar_drivers[$avatar_type]; return $driver; } -- cgit v1.2.1 From 7f58a4572eaca75aecff2da889e67ea151616011 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 28 Oct 2013 22:27:25 +0100 Subject: [ticket/11981] Fix code sniffer complaints PHPBB3-11981 --- phpBB/phpbb/auth/provider/ldap.php | 1 - phpBB/phpbb/auth/provider/oauth/oauth.php | 12 ++++++------ phpBB/phpbb/auth/provider/oauth/token_storage.php | 4 ++-- phpBB/phpbb/db/driver/mssql.php | 2 +- phpBB/phpbb/db/driver/mssqlnative.php | 4 ++-- phpBB/phpbb/db/driver/mysqli.php | 6 +++--- phpBB/phpbb/db/driver/postgres.php | 6 +++--- phpBB/phpbb/db/migration/data/v310/notifications.php | 2 +- .../db/migration/data/v310/notifications_schema_fix.php | 6 +++--- phpBB/phpbb/db/migration/data/v310/style_update_p2.php | 8 ++++---- phpBB/phpbb/db/migration/data/v310/teampage.php | 2 +- phpBB/phpbb/db/tools.php | 2 +- phpBB/phpbb/event/kernel_exception_subscriber.php | 1 - phpBB/phpbb/extension/manager.php | 6 ++++++ phpBB/phpbb/extension/metadata_manager.php | 2 +- phpBB/phpbb/feed/base.php | 2 +- phpBB/phpbb/notification/type/approve_topic.php | 2 +- phpBB/phpbb/search/fulltext_native.php | 1 - phpBB/phpbb/session.php | 1 - phpBB/phpbb/template/context.php | 4 ++-- phpBB/phpbb/template/twig/node/includephp.php | 2 +- phpBB/phpbb/template/twig/tokenparser/includephp.php | 2 +- phpBB/phpbb/user.php | 1 - 23 files changed, 40 insertions(+), 39 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/auth/provider/ldap.php b/phpBB/phpbb/auth/provider/ldap.php index 9d29789567..2123a587cb 100644 --- a/phpBB/phpbb/auth/provider/ldap.php +++ b/phpBB/phpbb/auth/provider/ldap.php @@ -97,7 +97,6 @@ class ldap extends \phpbb\auth\provider\base @ldap_close($ldap); - if (!is_array($result) || sizeof($result) < 2) { return sprintf($this->user->lang['LDAP_NO_IDENTITY'], $this->user->data['username']); diff --git a/phpBB/phpbb/auth/provider/oauth/oauth.php b/phpBB/phpbb/auth/provider/oauth/oauth.php index de81ac0d04..5df56db00a 100644 --- a/phpBB/phpbb/auth/provider/oauth/oauth.php +++ b/phpBB/phpbb/auth/provider/oauth/oauth.php @@ -179,7 +179,7 @@ class oauth extends \phpbb\auth\provider\base $storage = new \phpbb\auth\provider\oauth\token_storage($this->db, $this->user, $this->auth_provider_oauth_token_storage_table); $query = 'mode=login&login=external&oauth_service=' . $service_name_original; - $service = $this->get_service($service_name_original, $storage, $service_credentials, $this->service_providers[$service_name]->get_auth_scope(), $query); + $service = $this->get_service($service_name_original, $storage, $service_credentials, $query, $this->service_providers[$service_name]->get_auth_scope()); if ($this->request->is_set('code', \phpbb\request\request_interface::GET)) { @@ -273,13 +273,13 @@ class oauth extends \phpbb\auth\provider\base * @param string $service_name The name of the service * @param \phpbb\auth\provider\oauth\token_storage $storage * @param array $service_credentials {@see \phpbb\auth\provider\oauth\oauth::get_service_credentials} - * @param array $scope The scope of the request against - * the api. * @param string $query The query string of the * current_uri used in redirection + * @param array $scope The scope of the request against + * the api. * @return \OAuth\Common\Service\ServiceInterface */ - protected function get_service($service_name, \phpbb\auth\provider\oauth\token_storage $storage, array $service_credentials, array $scopes = array(), $query) + protected function get_service($service_name, \phpbb\auth\provider\oauth\token_storage $storage, array $service_credentials, $query, array $scopes = array()) { $current_uri = $this->get_current_uri($service_name, $query); @@ -458,7 +458,7 @@ class oauth extends \phpbb\auth\provider\base // Prepare for an authentication request $service_credentials = $this->service_providers[$service_name]->get_service_credentials(); $scopes = $this->service_providers[$service_name]->get_auth_scope(); - $service = $this->get_service(strtolower($link_data['oauth_service']), $storage, $service_credentials, $scopes, $query); + $service = $this->get_service(strtolower($link_data['oauth_service']), $storage, $service_credentials, $query, $scopes); $this->service_providers[$service_name]->set_external_service_provider($service); // The user has already authenticated successfully, request to authenticate again @@ -491,7 +491,7 @@ class oauth extends \phpbb\auth\provider\base $query = 'i=ucp_auth_link&mode=auth_link&link=1&oauth_service=' . strtolower($link_data['oauth_service']); $service_credentials = $this->service_providers[$service_name]->get_service_credentials(); $scopes = $this->service_providers[$service_name]->get_auth_scope(); - $service = $this->get_service(strtolower($link_data['oauth_service']), $storage, $service_credentials, $scopes, $query); + $service = $this->get_service(strtolower($link_data['oauth_service']), $storage, $service_credentials, $query, $scopes); if ($this->request->is_set('code', \phpbb\request\request_interface::GET)) { diff --git a/phpBB/phpbb/auth/provider/oauth/token_storage.php b/phpBB/phpbb/auth/provider/oauth/token_storage.php index 2ce0e32da3..cc912abf6d 100644 --- a/phpBB/phpbb/auth/provider/oauth/token_storage.php +++ b/phpBB/phpbb/auth/provider/oauth/token_storage.php @@ -78,7 +78,7 @@ class token_storage implements TokenStorageInterface { $service = $this->get_service_name_for_db($service); - if ($this->cachedToken instanceOf TokenInterface) + if ($this->cachedToken instanceof TokenInterface) { return $this->cachedToken; } @@ -238,7 +238,7 @@ class token_storage implements TokenStorageInterface { $service = $this->get_service_name_for_db($service); - if ($this->cachedToken instanceOf TokenInterface) { + if ($this->cachedToken instanceof TokenInterface) { return $this->cachedToken; } diff --git a/phpBB/phpbb/db/driver/mssql.php b/phpBB/phpbb/db/driver/mssql.php index 50096deded..e1b41461e2 100644 --- a/phpBB/phpbb/db/driver/mssql.php +++ b/phpBB/phpbb/db/driver/mssql.php @@ -259,7 +259,7 @@ class mssql extends \phpbb\db\driver\driver { foreach ($row as $key => $value) { - $row[$key] = ($value === ' ' || $value === NULL) ? '' : $value; + $row[$key] = ($value === ' ' || $value === null) ? '' : $value; } } diff --git a/phpBB/phpbb/db/driver/mssqlnative.php b/phpBB/phpbb/db/driver/mssqlnative.php index aade311bcb..2eb625fb11 100644 --- a/phpBB/phpbb/db/driver/mssqlnative.php +++ b/phpBB/phpbb/db/driver/mssqlnative.php @@ -195,7 +195,7 @@ class result_mssqlnative */ class mssqlnative extends \phpbb\db\driver\mssql_base { - var $m_insert_id = NULL; + var $m_insert_id = null; var $last_query_text = ''; var $query_options = array(); var $connect_error = ''; @@ -427,7 +427,7 @@ class mssqlnative extends \phpbb\db\driver\mssql_base { foreach ($row as $key => $value) { - $row[$key] = ($value === ' ' || $value === NULL) ? '' : $value; + $row[$key] = ($value === ' ' || $value === null) ? '' : $value; } // remove helper values from LIMIT queries diff --git a/phpBB/phpbb/db/driver/mysqli.php b/phpBB/phpbb/db/driver/mysqli.php index 4d0e43b464..6144dba0c4 100644 --- a/phpBB/phpbb/db/driver/mysqli.php +++ b/phpBB/phpbb/db/driver/mysqli.php @@ -47,11 +47,11 @@ class mysqli extends \phpbb\db\driver\mysql_base $this->server = ($this->persistency) ? 'p:' . (($sqlserver) ? $sqlserver : 'localhost') : $sqlserver; $this->dbname = $database; - $port = (!$port) ? NULL : $port; + $port = (!$port) ? null : $port; // If port is set and it is not numeric, most likely mysqli socket is set. // Try to map it to the $socket parameter. - $socket = NULL; + $socket = null; if ($port) { if (is_numeric($port)) @@ -61,7 +61,7 @@ class mysqli extends \phpbb\db\driver\mysql_base else { $socket = $port; - $port = NULL; + $port = null; } } diff --git a/phpBB/phpbb/db/driver/postgres.php b/phpBB/phpbb/db/driver/postgres.php index 9cbb1ecb07..5cd6578d87 100644 --- a/phpBB/phpbb/db/driver/postgres.php +++ b/phpBB/phpbb/db/driver/postgres.php @@ -328,7 +328,7 @@ class postgres extends \phpbb\db\driver\driver return false; } - $temp_result = @pg_fetch_assoc($temp_q_id, NULL); + $temp_result = @pg_fetch_assoc($temp_q_id, null); @pg_free_result($query_id); return ($temp_result) ? $temp_result['last_value'] : false; @@ -456,7 +456,7 @@ class postgres extends \phpbb\db\driver\driver if ($result = @pg_query($this->db_connect_id, "EXPLAIN $explain_query")) { - while ($row = @pg_fetch_assoc($result, NULL)) + while ($row = @pg_fetch_assoc($result, null)) { $html_table = $this->sql_report('add_select_row', $query, $html_table, $row); } @@ -476,7 +476,7 @@ class postgres extends \phpbb\db\driver\driver $endtime = $endtime[0] + $endtime[1]; $result = @pg_query($this->db_connect_id, $query); - while ($void = @pg_fetch_assoc($result, NULL)) + while ($void = @pg_fetch_assoc($result, null)) { // Take the time spent on parsing rows into account } diff --git a/phpBB/phpbb/db/migration/data/v310/notifications.php b/phpBB/phpbb/db/migration/data/v310/notifications.php index 10f1392094..61be25bb5f 100644 --- a/phpBB/phpbb/db/migration/data/v310/notifications.php +++ b/phpBB/phpbb/db/migration/data/v310/notifications.php @@ -34,7 +34,7 @@ class notifications extends \phpbb\db\migration\migration ), $this->table_prefix . 'notifications' => array( 'COLUMNS' => array( - 'notification_id' => array('UINT', NULL, 'auto_increment'), + 'notification_id' => array('UINT', null, 'auto_increment'), 'item_type' => array('VCHAR:255', ''), 'item_id' => array('UINT', 0), 'item_parent_id' => array('UINT', 0), diff --git a/phpBB/phpbb/db/migration/data/v310/notifications_schema_fix.php b/phpBB/phpbb/db/migration/data/v310/notifications_schema_fix.php index 8ed626d8a6..eb2eb361ee 100644 --- a/phpBB/phpbb/db/migration/data/v310/notifications_schema_fix.php +++ b/phpBB/phpbb/db/migration/data/v310/notifications_schema_fix.php @@ -26,7 +26,7 @@ class notifications_schema_fix extends \phpbb\db\migration\migration 'add_tables' => array( $this->table_prefix . 'notification_types' => array( 'COLUMNS' => array( - 'notification_type_id' => array('USINT', NULL, 'auto_increment'), + 'notification_type_id' => array('USINT', null, 'auto_increment'), 'notification_type_name' => array('VCHAR:255', ''), 'notification_type_enabled' => array('BOOL', 1), ), @@ -37,7 +37,7 @@ class notifications_schema_fix extends \phpbb\db\migration\migration ), $this->table_prefix . 'notifications' => array( 'COLUMNS' => array( - 'notification_id' => array('UINT:10', NULL, 'auto_increment'), + 'notification_id' => array('UINT:10', null, 'auto_increment'), 'notification_type_id' => array('USINT', 0), 'item_id' => array('UINT', 0), 'item_parent_id' => array('UINT', 0), @@ -73,7 +73,7 @@ class notifications_schema_fix extends \phpbb\db\migration\migration ), $this->table_prefix . 'notifications' => array( 'COLUMNS' => array( - 'notification_id' => array('UINT', NULL, 'auto_increment'), + 'notification_id' => array('UINT', null, 'auto_increment'), 'item_type' => array('VCHAR:255', ''), 'item_id' => array('UINT', 0), 'item_parent_id' => array('UINT', 0), diff --git a/phpBB/phpbb/db/migration/data/v310/style_update_p2.php b/phpBB/phpbb/db/migration/data/v310/style_update_p2.php index 202a8409fb..c5b45d9dc9 100644 --- a/phpBB/phpbb/db/migration/data/v310/style_update_p2.php +++ b/phpBB/phpbb/db/migration/data/v310/style_update_p2.php @@ -56,7 +56,7 @@ class style_update_p2 extends \phpbb\db\migration\migration 'add_tables' => array( $this->table_prefix . 'styles_imageset' => array( 'COLUMNS' => array( - 'imageset_id' => array('UINT', NULL, 'auto_increment'), + 'imageset_id' => array('UINT', null, 'auto_increment'), 'imageset_name' => array('VCHAR_UNI:255', ''), 'imageset_copyright' => array('VCHAR_UNI', ''), 'imageset_path' => array('VCHAR:100', ''), @@ -68,7 +68,7 @@ class style_update_p2 extends \phpbb\db\migration\migration ), $this->table_prefix . 'styles_imageset_data' => array( 'COLUMNS' => array( - 'image_id' => array('UINT', NULL, 'auto_increment'), + 'image_id' => array('UINT', null, 'auto_increment'), 'image_name' => array('VCHAR:200', ''), 'image_filename' => array('VCHAR:200', ''), 'image_lang' => array('VCHAR:30', ''), @@ -83,7 +83,7 @@ class style_update_p2 extends \phpbb\db\migration\migration ), $this->table_prefix . 'styles_template' => array( 'COLUMNS' => array( - 'template_id' => array('UINT', NULL, 'auto_increment'), + 'template_id' => array('UINT', null, 'auto_increment'), 'template_name' => array('VCHAR_UNI:255', ''), 'template_copyright' => array('VCHAR_UNI', ''), 'template_path' => array('VCHAR:100', ''), @@ -112,7 +112,7 @@ class style_update_p2 extends \phpbb\db\migration\migration ), $this->table_prefix . 'styles_theme' => array( 'COLUMNS' => array( - 'theme_id' => array('UINT', NULL, 'auto_increment'), + 'theme_id' => array('UINT', null, 'auto_increment'), 'theme_name' => array('VCHAR_UNI:255', ''), 'theme_copyright' => array('VCHAR_UNI', ''), 'theme_path' => array('VCHAR:100', ''), diff --git a/phpBB/phpbb/db/migration/data/v310/teampage.php b/phpBB/phpbb/db/migration/data/v310/teampage.php index 80cc4be1c0..172435c672 100644 --- a/phpBB/phpbb/db/migration/data/v310/teampage.php +++ b/phpBB/phpbb/db/migration/data/v310/teampage.php @@ -27,7 +27,7 @@ class teampage extends \phpbb\db\migration\migration 'add_tables' => array( $this->table_prefix . 'teampage' => array( 'COLUMNS' => array( - 'teampage_id' => array('UINT', NULL, 'auto_increment'), + 'teampage_id' => array('UINT', null, 'auto_increment'), 'group_id' => array('UINT', 0), 'teampage_name' => array('VCHAR_UNI:255', ''), 'teampage_position' => array('UINT', 0), diff --git a/phpBB/phpbb/db/tools.php b/phpBB/phpbb/db/tools.php index 1f156fbb04..d9bd8cf568 100644 --- a/phpBB/phpbb/db/tools.php +++ b/phpBB/phpbb/db/tools.php @@ -33,7 +33,7 @@ class tools /** * @var object DB object */ - var $db = NULL; + var $db = null; /** * The Column types for every database we support diff --git a/phpBB/phpbb/event/kernel_exception_subscriber.php b/phpBB/phpbb/event/kernel_exception_subscriber.php index 09103680e8..7003e73b38 100644 --- a/phpBB/phpbb/event/kernel_exception_subscriber.php +++ b/phpBB/phpbb/event/kernel_exception_subscriber.php @@ -72,7 +72,6 @@ class kernel_exception_subscriber implements EventSubscriberInterface page_footer(true, false, false); - $status_code = $exception instanceof HttpException ? $exception->getStatusCode() : 500; $response = new Response($this->template->assign_display('body'), $status_code); $event->setResponse($response); diff --git a/phpBB/phpbb/extension/manager.php b/phpBB/phpbb/extension/manager.php index ce6d7e05c8..f8beb963ba 100644 --- a/phpBB/phpbb/extension/manager.php +++ b/phpBB/phpbb/extension/manager.php @@ -234,7 +234,9 @@ class manager */ public function enable($name) { + // @codingStandardsIgnoreStart while ($this->enable_step($name)); + // @codingStandardsIgnoreEnd } /** @@ -311,7 +313,9 @@ class manager */ public function disable($name) { + // @codingStandardsIgnoreStart while ($this->disable_step($name)); + // @codingStandardsIgnoreEnd } /** @@ -388,7 +392,9 @@ class manager */ public function purge($name) { + // @codingStandardsIgnoreStart while ($this->purge_step($name)); + // @codingStandardsIgnoreEnd } /** diff --git a/phpBB/phpbb/extension/metadata_manager.php b/phpBB/phpbb/extension/metadata_manager.php index 19c6288e96..ff5d55c7f2 100644 --- a/phpBB/phpbb/extension/metadata_manager.php +++ b/phpBB/phpbb/extension/metadata_manager.php @@ -169,7 +169,7 @@ class metadata_manager throw new \phpbb\extension\exception('file_get_contents failed on ' . $this->metadata_file); } - if (($metadata = json_decode($file_contents, true)) === NULL) + if (($metadata = json_decode($file_contents, true)) === null) { throw new \phpbb\extension\exception('json_decode failed on ' . $this->metadata_file); } diff --git a/phpBB/phpbb/feed/base.php b/phpBB/phpbb/feed/base.php index de7dd41df4..8245b849a1 100644 --- a/phpBB/phpbb/feed/base.php +++ b/phpBB/phpbb/feed/base.php @@ -150,7 +150,7 @@ abstract class base */ function get($key) { - return (isset($this->keys[$key])) ? $this->keys[$key] : NULL; + return (isset($this->keys[$key])) ? $this->keys[$key] : null; } function get_readable_forums() diff --git a/phpBB/phpbb/notification/type/approve_topic.php b/phpBB/phpbb/notification/type/approve_topic.php index ca5bb67754..9f061b8be1 100644 --- a/phpBB/phpbb/notification/type/approve_topic.php +++ b/phpBB/phpbb/notification/type/approve_topic.php @@ -34,7 +34,7 @@ class approve_topic extends \phpbb\notification\type\topic { return 'approve_topic'; } - + /** * Language key used to output the text * diff --git a/phpBB/phpbb/search/fulltext_native.php b/phpBB/phpbb/search/fulltext_native.php index 33326f2882..024b8f441b 100644 --- a/phpBB/phpbb/search/fulltext_native.php +++ b/phpBB/phpbb/search/fulltext_native.php @@ -850,7 +850,6 @@ class fulltext_native extends \phpbb\search\base } $this->db->sql_freeresult($result); - // if we use mysql and the total result count is not cached yet, retrieve it from the db if (!$total_results && $is_mysql) { diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php index 5e4380bfc8..214ab8fd33 100644 --- a/phpBB/phpbb/session.php +++ b/phpBB/phpbb/session.php @@ -1235,7 +1235,6 @@ class session $this->session_create(ANONYMOUS); } - // Determine which message to output $till_date = ($ban_row['ban_end']) ? $this->format_date($ban_row['ban_end']) : ''; $message = ($ban_row['ban_end']) ? 'BOARD_BAN_TIME' : 'BOARD_BAN_PERM'; diff --git a/phpBB/phpbb/template/context.php b/phpBB/phpbb/template/context.php index 24234c1e4a..decd1c7956 100644 --- a/phpBB/phpbb/template/context.php +++ b/phpBB/phpbb/template/context.php @@ -285,7 +285,7 @@ class context // Search array to get correct position list($search_key, $search_value) = @each($key); - $key = NULL; + $key = null; foreach ($block as $i => $val_ary) { if ($val_ary[$search_key] === $search_value) @@ -296,7 +296,7 @@ class context } // key/value pair not found - if ($key === NULL) + if ($key === null) { return false; } diff --git a/phpBB/phpbb/template/twig/node/includephp.php b/phpBB/phpbb/template/twig/node/includephp.php index 4024cf0cc8..70dcf85d62 100644 --- a/phpBB/phpbb/template/twig/node/includephp.php +++ b/phpBB/phpbb/template/twig/node/includephp.php @@ -23,7 +23,7 @@ class includephp extends \Twig_Node /** @var Twig_Environment */ protected $environment; - public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $ignoreMissing = false, $lineno, $tag = null) + public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $lineno, $ignoreMissing = false, $tag = null) { $this->environment = $environment; diff --git a/phpBB/phpbb/template/twig/tokenparser/includephp.php b/phpBB/phpbb/template/twig/tokenparser/includephp.php index d906837590..25170e7214 100644 --- a/phpBB/phpbb/template/twig/tokenparser/includephp.php +++ b/phpBB/phpbb/template/twig/tokenparser/includephp.php @@ -43,7 +43,7 @@ class includephp extends \Twig_TokenParser $stream->expect(\Twig_Token::BLOCK_END_TYPE); - return new \phpbb\template\twig\node\includephp($expr, $this->parser->getEnvironment(), $ignoreMissing, $token->getLine(), $this->getTag()); + return new \phpbb\template\twig\node\includephp($expr, $this->parser->getEnvironment(), $token->getLine(), $ignoreMissing, $this->getTag()); } /** diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php index f97cc94d40..d82acbf501 100644 --- a/phpBB/phpbb/user.php +++ b/phpBB/phpbb/user.php @@ -343,7 +343,6 @@ class user extends \phpbb\session } } - // Does the user need to change their password? If so, redirect to the // ucp profile reg_details page ... of course do not redirect if we're already in the ucp if (!defined('IN_ADMIN') && !defined('ADMIN_START') && $config['chg_passforce'] && !empty($this->data['is_registered']) && $auth->acl_get('u_chgpasswd') && $this->data['user_passchg'] < time() - ($config['chg_passforce'] * 86400)) -- cgit v1.2.1 From 02e9f6e2840d7227f158b4baf96fd9c0f6207531 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 29 Oct 2013 21:31:07 +0100 Subject: [task/code-sniffer] Fix argument list spacing. PHPBB3-11980 --- phpBB/phpbb/db/driver/mysqli.php | 2 +- phpBB/phpbb/template/twig/node/includephp.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/db/driver/mysqli.php b/phpBB/phpbb/db/driver/mysqli.php index 6144dba0c4..aeb66c00cd 100644 --- a/phpBB/phpbb/db/driver/mysqli.php +++ b/phpBB/phpbb/db/driver/mysqli.php @@ -31,7 +31,7 @@ class mysqli extends \phpbb\db\driver\mysql_base /** * Connect to server */ - function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false , $new_link = false) + function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false) { if (!function_exists('mysqli_connect')) { diff --git a/phpBB/phpbb/template/twig/node/includephp.php b/phpBB/phpbb/template/twig/node/includephp.php index 70dcf85d62..1d3e51f54a 100644 --- a/phpBB/phpbb/template/twig/node/includephp.php +++ b/phpBB/phpbb/template/twig/node/includephp.php @@ -23,7 +23,7 @@ class includephp extends \Twig_Node /** @var Twig_Environment */ protected $environment; - public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $lineno, $ignoreMissing = false, $tag = null) + public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $lineno, $ignoreMissing = false, $tag = null) { $this->environment = $environment; -- cgit v1.2.1 From 7aa8f6461f1e85cf91931f56b95384e54fec07c2 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Wed, 30 Oct 2013 13:05:28 +0100 Subject: [task/code-sniffer] Remove the IN_PHPBB check side-effect from class files. PHPBB3-11980 --- phpBB/phpbb/auth/auth.php | 8 -------- phpBB/phpbb/auth/provider/apache.php | 8 -------- phpBB/phpbb/auth/provider/base.php | 8 -------- phpBB/phpbb/auth/provider/db.php | 8 -------- phpBB/phpbb/auth/provider/ldap.php | 8 -------- phpBB/phpbb/auth/provider/oauth/oauth.php | 8 -------- phpBB/phpbb/auth/provider/oauth/service/base.php | 8 -------- phpBB/phpbb/auth/provider/oauth/service/bitly.php | 8 -------- phpBB/phpbb/auth/provider/oauth/service/exception.php | 8 -------- phpBB/phpbb/auth/provider/oauth/service/facebook.php | 8 -------- phpBB/phpbb/auth/provider/oauth/service/google.php | 8 -------- phpBB/phpbb/auth/provider/oauth/service/service_interface.php | 8 -------- phpBB/phpbb/auth/provider/oauth/token_storage.php | 8 -------- phpBB/phpbb/auth/provider/provider_interface.php | 8 -------- phpBB/phpbb/avatar/driver/driver.php | 8 -------- phpBB/phpbb/avatar/driver/driver_interface.php | 8 -------- phpBB/phpbb/avatar/driver/gravatar.php | 8 -------- phpBB/phpbb/avatar/driver/local.php | 8 -------- phpBB/phpbb/avatar/driver/remote.php | 8 -------- phpBB/phpbb/avatar/driver/upload.php | 8 -------- phpBB/phpbb/avatar/manager.php | 8 -------- phpBB/phpbb/cache/driver/apc.php | 8 -------- phpBB/phpbb/cache/driver/base.php | 8 -------- phpBB/phpbb/cache/driver/driver_interface.php | 8 -------- phpBB/phpbb/cache/driver/eaccelerator.php | 8 -------- phpBB/phpbb/cache/driver/file.php | 8 -------- phpBB/phpbb/cache/driver/memcache.php | 8 -------- phpBB/phpbb/cache/driver/memory.php | 8 -------- phpBB/phpbb/cache/driver/null.php | 8 -------- phpBB/phpbb/cache/driver/redis.php | 8 -------- phpBB/phpbb/cache/driver/wincache.php | 8 -------- phpBB/phpbb/cache/driver/xcache.php | 8 -------- phpBB/phpbb/cache/service.php | 8 -------- phpBB/phpbb/class_loader.php | 8 -------- phpBB/phpbb/config/config.php | 8 -------- phpBB/phpbb/config/db.php | 8 -------- phpBB/phpbb/config/db_text.php | 8 -------- phpBB/phpbb/content_visibility.php | 8 -------- phpBB/phpbb/controller/exception.php | 8 -------- phpBB/phpbb/controller/helper.php | 8 -------- phpBB/phpbb/controller/provider.php | 8 -------- phpBB/phpbb/controller/resolver.php | 8 -------- phpBB/phpbb/cron/manager.php | 8 -------- phpBB/phpbb/cron/task/base.php | 8 -------- phpBB/phpbb/cron/task/core/prune_all_forums.php | 8 -------- phpBB/phpbb/cron/task/core/prune_forum.php | 8 -------- phpBB/phpbb/cron/task/core/prune_notifications.php | 8 -------- phpBB/phpbb/cron/task/core/queue.php | 8 -------- phpBB/phpbb/cron/task/core/tidy_cache.php | 8 -------- phpBB/phpbb/cron/task/core/tidy_database.php | 8 -------- phpBB/phpbb/cron/task/core/tidy_plupload.php | 8 -------- phpBB/phpbb/cron/task/core/tidy_search.php | 8 -------- phpBB/phpbb/cron/task/core/tidy_sessions.php | 8 -------- phpBB/phpbb/cron/task/core/tidy_warnings.php | 8 -------- phpBB/phpbb/cron/task/parametrized.php | 8 -------- phpBB/phpbb/cron/task/task.php | 8 -------- phpBB/phpbb/cron/task/wrapper.php | 8 -------- phpBB/phpbb/db/driver/driver.php | 8 -------- phpBB/phpbb/db/driver/firebird.php | 8 -------- phpBB/phpbb/db/driver/mssql.php | 8 -------- phpBB/phpbb/db/driver/mssql_base.php | 8 -------- phpBB/phpbb/db/driver/mssql_odbc.php | 8 -------- phpBB/phpbb/db/driver/mssqlnative.php | 8 -------- phpBB/phpbb/db/driver/mysql.php | 8 -------- phpBB/phpbb/db/driver/mysql_base.php | 8 -------- phpBB/phpbb/db/driver/mysqli.php | 8 -------- phpBB/phpbb/db/driver/oracle.php | 8 -------- phpBB/phpbb/db/driver/postgres.php | 8 -------- phpBB/phpbb/db/driver/sqlite.php | 8 -------- phpBB/phpbb/db/migration/exception.php | 8 -------- phpBB/phpbb/db/migration/migration.php | 8 -------- phpBB/phpbb/db/migrator.php | 8 -------- phpBB/phpbb/db/sql_insert_buffer.php | 8 -------- phpBB/phpbb/db/tools.php | 8 -------- phpBB/phpbb/di/extension/config.php | 8 -------- phpBB/phpbb/di/extension/core.php | 8 -------- phpBB/phpbb/di/extension/ext.php | 8 -------- phpBB/phpbb/di/pass/collection_pass.php | 8 -------- phpBB/phpbb/di/pass/kernel_pass.php | 8 -------- phpBB/phpbb/di/service_collection.php | 8 -------- phpBB/phpbb/error_collector.php | 8 -------- phpBB/phpbb/event/data.php | 8 -------- phpBB/phpbb/event/dispatcher.php | 8 -------- phpBB/phpbb/event/extension_subscriber_loader.php | 8 -------- phpBB/phpbb/event/kernel_exception_subscriber.php | 8 -------- phpBB/phpbb/event/kernel_request_subscriber.php | 8 -------- phpBB/phpbb/event/kernel_terminate_subscriber.php | 8 -------- phpBB/phpbb/extension/base.php | 8 -------- phpBB/phpbb/extension/exception.php | 8 -------- phpBB/phpbb/extension/extension_interface.php | 8 -------- phpBB/phpbb/extension/finder.php | 8 -------- phpBB/phpbb/extension/manager.php | 8 -------- phpBB/phpbb/extension/metadata_manager.php | 8 -------- phpBB/phpbb/extension/provider.php | 8 -------- phpBB/phpbb/feed/base.php | 8 -------- phpBB/phpbb/feed/factory.php | 8 -------- phpBB/phpbb/feed/forum.php | 8 -------- phpBB/phpbb/feed/forums.php | 8 -------- phpBB/phpbb/feed/helper.php | 8 -------- phpBB/phpbb/feed/news.php | 8 -------- phpBB/phpbb/feed/overall.php | 8 -------- phpBB/phpbb/feed/post_base.php | 8 -------- phpBB/phpbb/feed/topic.php | 8 -------- phpBB/phpbb/feed/topic_base.php | 8 -------- phpBB/phpbb/feed/topics.php | 8 -------- phpBB/phpbb/feed/topics_active.php | 8 -------- phpBB/phpbb/filesystem.php | 8 -------- phpBB/phpbb/groupposition/exception.php | 8 -------- phpBB/phpbb/groupposition/groupposition_interface.php | 8 -------- phpBB/phpbb/groupposition/legend.php | 8 -------- phpBB/phpbb/groupposition/teampage.php | 8 -------- phpBB/phpbb/hook/finder.php | 8 -------- phpBB/phpbb/json_response.php | 8 -------- phpBB/phpbb/lock/db.php | 8 -------- phpBB/phpbb/lock/flock.php | 8 -------- phpBB/phpbb/log/log.php | 8 -------- phpBB/phpbb/log/log_interface.php | 8 -------- phpBB/phpbb/log/null.php | 8 -------- phpBB/phpbb/notification/exception.php | 8 -------- phpBB/phpbb/notification/manager.php | 8 -------- phpBB/phpbb/notification/method/base.php | 8 -------- phpBB/phpbb/notification/method/email.php | 8 -------- phpBB/phpbb/notification/method/jabber.php | 8 -------- phpBB/phpbb/notification/method/messenger_base.php | 8 -------- phpBB/phpbb/notification/method/method_interface.php | 8 -------- phpBB/phpbb/notification/type/approve_post.php | 8 -------- phpBB/phpbb/notification/type/approve_topic.php | 8 -------- phpBB/phpbb/notification/type/base.php | 8 -------- phpBB/phpbb/notification/type/bookmark.php | 8 -------- phpBB/phpbb/notification/type/disapprove_post.php | 8 -------- phpBB/phpbb/notification/type/disapprove_topic.php | 8 -------- phpBB/phpbb/notification/type/group_request.php | 8 -------- phpBB/phpbb/notification/type/group_request_approved.php | 8 -------- phpBB/phpbb/notification/type/pm.php | 8 -------- phpBB/phpbb/notification/type/post.php | 8 -------- phpBB/phpbb/notification/type/post_in_queue.php | 8 -------- phpBB/phpbb/notification/type/quote.php | 8 -------- phpBB/phpbb/notification/type/report_pm.php | 8 -------- phpBB/phpbb/notification/type/report_pm_closed.php | 8 -------- phpBB/phpbb/notification/type/report_post.php | 8 -------- phpBB/phpbb/notification/type/report_post_closed.php | 8 -------- phpBB/phpbb/notification/type/topic.php | 8 -------- phpBB/phpbb/notification/type/topic_in_queue.php | 8 -------- phpBB/phpbb/notification/type/type_interface.php | 8 -------- phpBB/phpbb/path_helper.php | 8 -------- phpBB/phpbb/permissions.php | 8 -------- phpBB/phpbb/php/ini.php | 8 -------- phpBB/phpbb/plupload/plupload.php | 8 -------- phpBB/phpbb/request/deactivated_super_global.php | 8 -------- phpBB/phpbb/request/request.php | 8 -------- phpBB/phpbb/request/request_interface.php | 8 -------- phpBB/phpbb/request/type_cast_helper.php | 8 -------- phpBB/phpbb/request/type_cast_helper_interface.php | 8 -------- phpBB/phpbb/search/base.php | 8 -------- phpBB/phpbb/search/fulltext_mysql.php | 8 -------- phpBB/phpbb/search/fulltext_native.php | 8 -------- phpBB/phpbb/search/fulltext_postgres.php | 8 -------- phpBB/phpbb/search/fulltext_sphinx.php | 10 ---------- phpBB/phpbb/search/sphinx/config.php | 8 -------- phpBB/phpbb/search/sphinx/config_comment.php | 8 -------- phpBB/phpbb/search/sphinx/config_section.php | 8 -------- phpBB/phpbb/search/sphinx/config_variable.php | 8 -------- phpBB/phpbb/session.php | 8 -------- phpBB/phpbb/symfony_request.php | 8 -------- phpBB/phpbb/template/asset.php | 8 -------- phpBB/phpbb/template/base.php | 8 -------- phpBB/phpbb/template/context.php | 8 -------- phpBB/phpbb/template/template.php | 8 -------- phpBB/phpbb/template/twig/definition.php | 8 -------- phpBB/phpbb/template/twig/environment.php | 8 -------- phpBB/phpbb/template/twig/extension.php | 8 -------- phpBB/phpbb/template/twig/lexer.php | 8 -------- phpBB/phpbb/template/twig/loader.php | 8 -------- phpBB/phpbb/template/twig/node/definenode.php | 8 -------- phpBB/phpbb/template/twig/node/event.php | 8 -------- .../phpbb/template/twig/node/expression/binary/equalequal.php | 8 -------- .../template/twig/node/expression/binary/notequalequal.php | 8 -------- phpBB/phpbb/template/twig/node/includenode.php | 8 -------- phpBB/phpbb/template/twig/node/includephp.php | 8 -------- phpBB/phpbb/template/twig/node/php.php | 8 -------- phpBB/phpbb/template/twig/tokenparser/defineparser.php | 8 -------- phpBB/phpbb/template/twig/tokenparser/event.php | 8 -------- phpBB/phpbb/template/twig/tokenparser/includejs.php | 8 -------- phpBB/phpbb/template/twig/tokenparser/includeparser.php | 8 -------- phpBB/phpbb/template/twig/tokenparser/includephp.php | 8 -------- phpBB/phpbb/template/twig/tokenparser/php.php | 8 -------- phpBB/phpbb/template/twig/twig.php | 8 -------- phpBB/phpbb/tree/nestedset.php | 8 -------- phpBB/phpbb/tree/nestedset_forum.php | 8 -------- phpBB/phpbb/tree/tree_interface.php | 8 -------- phpBB/phpbb/user.php | 8 -------- phpBB/phpbb/user_loader.php | 7 ------- 192 files changed, 1537 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/auth/auth.php b/phpBB/phpbb/auth/auth.php index b5cc675838..81676e75fc 100644 --- a/phpBB/phpbb/auth/auth.php +++ b/phpBB/phpbb/auth/auth.php @@ -9,14 +9,6 @@ namespace phpbb\auth; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Permission/Auth class * @package phpBB3 diff --git a/phpBB/phpbb/auth/provider/apache.php b/phpBB/phpbb/auth/provider/apache.php index 5cbb63c4fc..77bc976938 100644 --- a/phpBB/phpbb/auth/provider/apache.php +++ b/phpBB/phpbb/auth/provider/apache.php @@ -9,14 +9,6 @@ namespace phpbb\auth\provider; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Apache authentication provider for phpBB3 * diff --git a/phpBB/phpbb/auth/provider/base.php b/phpBB/phpbb/auth/provider/base.php index 2222d8c1b6..78a3289356 100644 --- a/phpBB/phpbb/auth/provider/base.php +++ b/phpBB/phpbb/auth/provider/base.php @@ -9,14 +9,6 @@ namespace phpbb\auth\provider; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Base authentication provider class that all other providers should implement * diff --git a/phpBB/phpbb/auth/provider/db.php b/phpBB/phpbb/auth/provider/db.php index 4654e49fb5..6ea04eab36 100644 --- a/phpBB/phpbb/auth/provider/db.php +++ b/phpBB/phpbb/auth/provider/db.php @@ -9,14 +9,6 @@ namespace phpbb\auth\provider; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Database authentication provider for phpBB3 * diff --git a/phpBB/phpbb/auth/provider/ldap.php b/phpBB/phpbb/auth/provider/ldap.php index 2123a587cb..4ce43853bd 100644 --- a/phpBB/phpbb/auth/provider/ldap.php +++ b/phpBB/phpbb/auth/provider/ldap.php @@ -9,14 +9,6 @@ namespace phpbb\auth\provider; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Database authentication provider for phpBB3 * diff --git a/phpBB/phpbb/auth/provider/oauth/oauth.php b/phpBB/phpbb/auth/provider/oauth/oauth.php index 5df56db00a..2749661269 100644 --- a/phpBB/phpbb/auth/provider/oauth/oauth.php +++ b/phpBB/phpbb/auth/provider/oauth/oauth.php @@ -9,14 +9,6 @@ namespace phpbb\auth\provider\oauth; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - use OAuth\Common\Consumer\Credentials; use OAuth\Common\Http\Uri\Uri; diff --git a/phpBB/phpbb/auth/provider/oauth/service/base.php b/phpBB/phpbb/auth/provider/oauth/service/base.php index 61deb48695..7a144d2f51 100644 --- a/phpBB/phpbb/auth/provider/oauth/service/base.php +++ b/phpBB/phpbb/auth/provider/oauth/service/base.php @@ -9,14 +9,6 @@ namespace phpbb\auth\provider\oauth\service; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Base OAuth abstract class that all OAuth services should implement * diff --git a/phpBB/phpbb/auth/provider/oauth/service/bitly.php b/phpBB/phpbb/auth/provider/oauth/service/bitly.php index 47cf7ee380..b4050033a6 100644 --- a/phpBB/phpbb/auth/provider/oauth/service/bitly.php +++ b/phpBB/phpbb/auth/provider/oauth/service/bitly.php @@ -9,14 +9,6 @@ namespace phpbb\auth\provider\oauth\service; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Bitly OAuth service * diff --git a/phpBB/phpbb/auth/provider/oauth/service/exception.php b/phpBB/phpbb/auth/provider/oauth/service/exception.php index 0c6cba9fb8..3bc93be01e 100644 --- a/phpBB/phpbb/auth/provider/oauth/service/exception.php +++ b/phpBB/phpbb/auth/provider/oauth/service/exception.php @@ -9,14 +9,6 @@ namespace phpbb\auth\provider\oauth\service; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * OAuth service exception class * diff --git a/phpBB/phpbb/auth/provider/oauth/service/facebook.php b/phpBB/phpbb/auth/provider/oauth/service/facebook.php index 4a4eeba6d5..2698be8b18 100644 --- a/phpBB/phpbb/auth/provider/oauth/service/facebook.php +++ b/phpBB/phpbb/auth/provider/oauth/service/facebook.php @@ -9,14 +9,6 @@ namespace phpbb\auth\provider\oauth\service; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Facebook OAuth service * diff --git a/phpBB/phpbb/auth/provider/oauth/service/google.php b/phpBB/phpbb/auth/provider/oauth/service/google.php index 2449bbf523..08cb025c2d 100644 --- a/phpBB/phpbb/auth/provider/oauth/service/google.php +++ b/phpBB/phpbb/auth/provider/oauth/service/google.php @@ -9,14 +9,6 @@ namespace phpbb\auth\provider\oauth\service; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Google OAuth service * diff --git a/phpBB/phpbb/auth/provider/oauth/service/service_interface.php b/phpBB/phpbb/auth/provider/oauth/service/service_interface.php index ab69fe6ef3..eee3a51cac 100644 --- a/phpBB/phpbb/auth/provider/oauth/service/service_interface.php +++ b/phpBB/phpbb/auth/provider/oauth/service/service_interface.php @@ -9,14 +9,6 @@ namespace phpbb\auth\provider\oauth\service; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * OAuth service interface * diff --git a/phpBB/phpbb/auth/provider/oauth/token_storage.php b/phpBB/phpbb/auth/provider/oauth/token_storage.php index cc912abf6d..43574288dc 100644 --- a/phpBB/phpbb/auth/provider/oauth/token_storage.php +++ b/phpBB/phpbb/auth/provider/oauth/token_storage.php @@ -9,14 +9,6 @@ namespace phpbb\auth\provider\oauth; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - use OAuth\OAuth1\Token\StdOAuth1Token; use OAuth\Common\Token\TokenInterface; diff --git a/phpBB/phpbb/auth/provider/provider_interface.php b/phpBB/phpbb/auth/provider/provider_interface.php index 1bb209c821..946731f52d 100644 --- a/phpBB/phpbb/auth/provider/provider_interface.php +++ b/phpBB/phpbb/auth/provider/provider_interface.php @@ -9,14 +9,6 @@ namespace phpbb\auth\provider; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * The interface authentication provider classes have to implement. * diff --git a/phpBB/phpbb/avatar/driver/driver.php b/phpBB/phpbb/avatar/driver/driver.php index 206df86543..d360614122 100644 --- a/phpBB/phpbb/avatar/driver/driver.php +++ b/phpBB/phpbb/avatar/driver/driver.php @@ -9,14 +9,6 @@ namespace phpbb\avatar\driver; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Base class for avatar drivers * @package phpBB3 diff --git a/phpBB/phpbb/avatar/driver/driver_interface.php b/phpBB/phpbb/avatar/driver/driver_interface.php index d9540c19db..7f049469a2 100644 --- a/phpBB/phpbb/avatar/driver/driver_interface.php +++ b/phpBB/phpbb/avatar/driver/driver_interface.php @@ -9,14 +9,6 @@ namespace phpbb\avatar\driver; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Interface for avatar drivers * @package phpBB3 diff --git a/phpBB/phpbb/avatar/driver/gravatar.php b/phpBB/phpbb/avatar/driver/gravatar.php index 3ad783932e..d64f4da734 100644 --- a/phpBB/phpbb/avatar/driver/gravatar.php +++ b/phpBB/phpbb/avatar/driver/gravatar.php @@ -9,14 +9,6 @@ namespace phpbb\avatar\driver; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Handles avatars hosted at gravatar.com * @package phpBB3 diff --git a/phpBB/phpbb/avatar/driver/local.php b/phpBB/phpbb/avatar/driver/local.php index 0686ffe79a..f6acc6e636 100644 --- a/phpBB/phpbb/avatar/driver/local.php +++ b/phpBB/phpbb/avatar/driver/local.php @@ -9,14 +9,6 @@ namespace phpbb\avatar\driver; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Handles avatars selected from the board gallery * @package phpBB3 diff --git a/phpBB/phpbb/avatar/driver/remote.php b/phpBB/phpbb/avatar/driver/remote.php index 1aa638dfe5..12cbd883f4 100644 --- a/phpBB/phpbb/avatar/driver/remote.php +++ b/phpBB/phpbb/avatar/driver/remote.php @@ -9,14 +9,6 @@ namespace phpbb\avatar\driver; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Handles avatars hosted remotely * @package phpBB3 diff --git a/phpBB/phpbb/avatar/driver/upload.php b/phpBB/phpbb/avatar/driver/upload.php index bda872df7a..822c40af98 100644 --- a/phpBB/phpbb/avatar/driver/upload.php +++ b/phpBB/phpbb/avatar/driver/upload.php @@ -9,14 +9,6 @@ namespace phpbb\avatar\driver; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Handles avatars uploaded to the board * @package phpBB3 diff --git a/phpBB/phpbb/avatar/manager.php b/phpBB/phpbb/avatar/manager.php index 7c26bce5ae..5fe5e2b0a1 100644 --- a/phpBB/phpbb/avatar/manager.php +++ b/phpBB/phpbb/avatar/manager.php @@ -9,14 +9,6 @@ namespace phpbb\avatar; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * @package avatar */ diff --git a/phpBB/phpbb/cache/driver/apc.php b/phpBB/phpbb/cache/driver/apc.php index ce72ec6134..a28d91c00a 100644 --- a/phpBB/phpbb/cache/driver/apc.php +++ b/phpBB/phpbb/cache/driver/apc.php @@ -9,14 +9,6 @@ namespace phpbb\cache\driver; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * ACM for APC * @package acm diff --git a/phpBB/phpbb/cache/driver/base.php b/phpBB/phpbb/cache/driver/base.php index 90185a00d2..feaca25a5b 100644 --- a/phpBB/phpbb/cache/driver/base.php +++ b/phpBB/phpbb/cache/driver/base.php @@ -9,14 +9,6 @@ namespace phpbb\cache\driver; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * @package acm */ diff --git a/phpBB/phpbb/cache/driver/driver_interface.php b/phpBB/phpbb/cache/driver/driver_interface.php index 34c60b5935..0715a4b934 100644 --- a/phpBB/phpbb/cache/driver/driver_interface.php +++ b/phpBB/phpbb/cache/driver/driver_interface.php @@ -9,14 +9,6 @@ namespace phpbb\cache\driver; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * An interface that all cache drivers must implement * diff --git a/phpBB/phpbb/cache/driver/eaccelerator.php b/phpBB/phpbb/cache/driver/eaccelerator.php index 72c0d77d02..2629cb53e5 100644 --- a/phpBB/phpbb/cache/driver/eaccelerator.php +++ b/phpBB/phpbb/cache/driver/eaccelerator.php @@ -9,14 +9,6 @@ namespace phpbb\cache\driver; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * ACM for eAccelerator * @package acm diff --git a/phpBB/phpbb/cache/driver/file.php b/phpBB/phpbb/cache/driver/file.php index a64232400b..6686da6953 100644 --- a/phpBB/phpbb/cache/driver/file.php +++ b/phpBB/phpbb/cache/driver/file.php @@ -9,14 +9,6 @@ namespace phpbb\cache\driver; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * ACM File Based Caching * @package acm diff --git a/phpBB/phpbb/cache/driver/memcache.php b/phpBB/phpbb/cache/driver/memcache.php index 84fe68ae49..c725ec0fb0 100644 --- a/phpBB/phpbb/cache/driver/memcache.php +++ b/phpBB/phpbb/cache/driver/memcache.php @@ -9,14 +9,6 @@ namespace phpbb\cache\driver; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - if (!defined('PHPBB_ACM_MEMCACHE_PORT')) { define('PHPBB_ACM_MEMCACHE_PORT', 11211); diff --git a/phpBB/phpbb/cache/driver/memory.php b/phpBB/phpbb/cache/driver/memory.php index 5a9861913f..292024212b 100644 --- a/phpBB/phpbb/cache/driver/memory.php +++ b/phpBB/phpbb/cache/driver/memory.php @@ -9,14 +9,6 @@ namespace phpbb\cache\driver; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * ACM Abstract Memory Class * @package acm diff --git a/phpBB/phpbb/cache/driver/null.php b/phpBB/phpbb/cache/driver/null.php index c03319ad61..ea535ca1e1 100644 --- a/phpBB/phpbb/cache/driver/null.php +++ b/phpBB/phpbb/cache/driver/null.php @@ -9,14 +9,6 @@ namespace phpbb\cache\driver; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * ACM Null Caching * @package acm diff --git a/phpBB/phpbb/cache/driver/redis.php b/phpBB/phpbb/cache/driver/redis.php index 317d07428a..3c6cb0e138 100644 --- a/phpBB/phpbb/cache/driver/redis.php +++ b/phpBB/phpbb/cache/driver/redis.php @@ -9,14 +9,6 @@ namespace phpbb\cache\driver; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - if (!defined('PHPBB_ACM_REDIS_PORT')) { define('PHPBB_ACM_REDIS_PORT', 6379); diff --git a/phpBB/phpbb/cache/driver/wincache.php b/phpBB/phpbb/cache/driver/wincache.php index a0b24e4a1f..1f040e9ab2 100644 --- a/phpBB/phpbb/cache/driver/wincache.php +++ b/phpBB/phpbb/cache/driver/wincache.php @@ -9,14 +9,6 @@ namespace phpbb\cache\driver; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * ACM for WinCache * @package acm diff --git a/phpBB/phpbb/cache/driver/xcache.php b/phpBB/phpbb/cache/driver/xcache.php index fdcbf7e4b5..4d0d683b3d 100644 --- a/phpBB/phpbb/cache/driver/xcache.php +++ b/phpBB/phpbb/cache/driver/xcache.php @@ -9,14 +9,6 @@ namespace phpbb\cache\driver; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * ACM for XCache * @package acm diff --git a/phpBB/phpbb/cache/service.php b/phpBB/phpbb/cache/service.php index da8f4eb8d8..ebbcfb8cdb 100644 --- a/phpBB/phpbb/cache/service.php +++ b/phpBB/phpbb/cache/service.php @@ -9,14 +9,6 @@ namespace phpbb\cache; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Class for grabbing/handling cached entries * @package acm diff --git a/phpBB/phpbb/class_loader.php b/phpBB/phpbb/class_loader.php index 769f28b4f1..5fe2c16aa4 100644 --- a/phpBB/phpbb/class_loader.php +++ b/phpBB/phpbb/class_loader.php @@ -9,14 +9,6 @@ namespace phpbb; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * The class loader resolves class names to file system paths and loads them if * necessary. diff --git a/phpBB/phpbb/config/config.php b/phpBB/phpbb/config/config.php index dc865df707..d37922acf1 100644 --- a/phpBB/phpbb/config/config.php +++ b/phpBB/phpbb/config/config.php @@ -9,14 +9,6 @@ namespace phpbb\config; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Configuration container class * @package phpBB3 diff --git a/phpBB/phpbb/config/db.php b/phpBB/phpbb/config/db.php index 0a490af14f..c1a3630a14 100644 --- a/phpBB/phpbb/config/db.php +++ b/phpBB/phpbb/config/db.php @@ -9,14 +9,6 @@ namespace phpbb\config; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Configuration container class * @package phpBB3 diff --git a/phpBB/phpbb/config/db_text.php b/phpBB/phpbb/config/db_text.php index 3ee3351e19..b1ea112b53 100644 --- a/phpBB/phpbb/config/db_text.php +++ b/phpBB/phpbb/config/db_text.php @@ -9,14 +9,6 @@ namespace phpbb\config; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Manages configuration options with an arbitrary length value stored in a TEXT * column. In constrast to class \phpbb\config\db, values are never cached and diff --git a/phpBB/phpbb/content_visibility.php b/phpBB/phpbb/content_visibility.php index 0b351bc9ec..874889015a 100644 --- a/phpBB/phpbb/content_visibility.php +++ b/phpBB/phpbb/content_visibility.php @@ -9,14 +9,6 @@ namespace phpbb; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * phpbb_visibility * Handle fetching and setting the visibility for topics and posts diff --git a/phpBB/phpbb/controller/exception.php b/phpBB/phpbb/controller/exception.php index e8694b8bcf..06ece8d1d5 100644 --- a/phpBB/phpbb/controller/exception.php +++ b/phpBB/phpbb/controller/exception.php @@ -9,14 +9,6 @@ namespace phpbb\controller; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Controller exception class * @package phpBB3 diff --git a/phpBB/phpbb/controller/helper.php b/phpBB/phpbb/controller/helper.php index 07483a91eb..05a05d1e57 100644 --- a/phpBB/phpbb/controller/helper.php +++ b/phpBB/phpbb/controller/helper.php @@ -9,14 +9,6 @@ namespace phpbb\controller; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - use Symfony\Component\HttpFoundation\Response; /** diff --git a/phpBB/phpbb/controller/provider.php b/phpBB/phpbb/controller/provider.php index 048ca72084..fde51696e8 100644 --- a/phpBB/phpbb/controller/provider.php +++ b/phpBB/phpbb/controller/provider.php @@ -9,14 +9,6 @@ namespace phpbb\controller; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - use Symfony\Component\Routing\RouteCollection; use Symfony\Component\Routing\Loader\YamlFileLoader; use Symfony\Component\Config\FileLocator; diff --git a/phpBB/phpbb/controller/resolver.php b/phpBB/phpbb/controller/resolver.php index 1cc8981105..233179e343 100644 --- a/phpBB/phpbb/controller/resolver.php +++ b/phpBB/phpbb/controller/resolver.php @@ -9,14 +9,6 @@ namespace phpbb\controller; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; diff --git a/phpBB/phpbb/cron/manager.php b/phpBB/phpbb/cron/manager.php index f58ba64a3d..b6af07aff7 100644 --- a/phpBB/phpbb/cron/manager.php +++ b/phpBB/phpbb/cron/manager.php @@ -9,14 +9,6 @@ namespace phpbb\cron; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Cron manager class. * diff --git a/phpBB/phpbb/cron/task/base.php b/phpBB/phpbb/cron/task/base.php index f30c9daf1b..63f0407bcd 100644 --- a/phpBB/phpbb/cron/task/base.php +++ b/phpBB/phpbb/cron/task/base.php @@ -9,14 +9,6 @@ namespace phpbb\cron\task; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Cron task base class. Provides sensible defaults for cron tasks * and partially implements cron task interface, making writing cron tasks easier. diff --git a/phpBB/phpbb/cron/task/core/prune_all_forums.php b/phpBB/phpbb/cron/task/core/prune_all_forums.php index 8e3ef25ce6..90b9a5914b 100644 --- a/phpBB/phpbb/cron/task/core/prune_all_forums.php +++ b/phpBB/phpbb/cron/task/core/prune_all_forums.php @@ -9,14 +9,6 @@ namespace phpbb\cron\task\core; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Prune all forums cron task. * diff --git a/phpBB/phpbb/cron/task/core/prune_forum.php b/phpBB/phpbb/cron/task/core/prune_forum.php index f14ab7b702..e0d8b067c5 100644 --- a/phpBB/phpbb/cron/task/core/prune_forum.php +++ b/phpBB/phpbb/cron/task/core/prune_forum.php @@ -9,14 +9,6 @@ namespace phpbb\cron\task\core; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Prune one forum cron task. * diff --git a/phpBB/phpbb/cron/task/core/prune_notifications.php b/phpBB/phpbb/cron/task/core/prune_notifications.php index 1f75709322..9f67c54e1c 100644 --- a/phpBB/phpbb/cron/task/core/prune_notifications.php +++ b/phpBB/phpbb/cron/task/core/prune_notifications.php @@ -9,14 +9,6 @@ namespace phpbb\cron\task\core; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Prune notifications cron task. * diff --git a/phpBB/phpbb/cron/task/core/queue.php b/phpBB/phpbb/cron/task/core/queue.php index cb13df86df..cd799b8024 100644 --- a/phpBB/phpbb/cron/task/core/queue.php +++ b/phpBB/phpbb/cron/task/core/queue.php @@ -9,14 +9,6 @@ namespace phpbb\cron\task\core; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Queue cron task. Sends email and jabber messages queued by other scripts. * diff --git a/phpBB/phpbb/cron/task/core/tidy_cache.php b/phpBB/phpbb/cron/task/core/tidy_cache.php index 021d5fd8a3..a94a85db53 100644 --- a/phpBB/phpbb/cron/task/core/tidy_cache.php +++ b/phpBB/phpbb/cron/task/core/tidy_cache.php @@ -9,14 +9,6 @@ namespace phpbb\cron\task\core; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Tidy cache cron task. * diff --git a/phpBB/phpbb/cron/task/core/tidy_database.php b/phpBB/phpbb/cron/task/core/tidy_database.php index d03cba1d86..f712a5047c 100644 --- a/phpBB/phpbb/cron/task/core/tidy_database.php +++ b/phpBB/phpbb/cron/task/core/tidy_database.php @@ -9,14 +9,6 @@ namespace phpbb\cron\task\core; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Tidy database cron task. * diff --git a/phpBB/phpbb/cron/task/core/tidy_plupload.php b/phpBB/phpbb/cron/task/core/tidy_plupload.php index 09e9dfa6b4..5a98e0bd7b 100644 --- a/phpBB/phpbb/cron/task/core/tidy_plupload.php +++ b/phpBB/phpbb/cron/task/core/tidy_plupload.php @@ -9,14 +9,6 @@ namespace phpbb\cron\task\core; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Cron task for cleaning plupload's temporary upload directory. * diff --git a/phpBB/phpbb/cron/task/core/tidy_search.php b/phpBB/phpbb/cron/task/core/tidy_search.php index ebd0d86cbc..42f7df308f 100644 --- a/phpBB/phpbb/cron/task/core/tidy_search.php +++ b/phpBB/phpbb/cron/task/core/tidy_search.php @@ -9,14 +9,6 @@ namespace phpbb\cron\task\core; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Tidy search cron task. * diff --git a/phpBB/phpbb/cron/task/core/tidy_sessions.php b/phpBB/phpbb/cron/task/core/tidy_sessions.php index 5df019ae46..68094af1f7 100644 --- a/phpBB/phpbb/cron/task/core/tidy_sessions.php +++ b/phpBB/phpbb/cron/task/core/tidy_sessions.php @@ -9,14 +9,6 @@ namespace phpbb\cron\task\core; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Tidy sessions cron task. * diff --git a/phpBB/phpbb/cron/task/core/tidy_warnings.php b/phpBB/phpbb/cron/task/core/tidy_warnings.php index 1cc0abbe88..a0ff23fc57 100644 --- a/phpBB/phpbb/cron/task/core/tidy_warnings.php +++ b/phpBB/phpbb/cron/task/core/tidy_warnings.php @@ -9,14 +9,6 @@ namespace phpbb\cron\task\core; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Tidy warnings cron task. * diff --git a/phpBB/phpbb/cron/task/parametrized.php b/phpBB/phpbb/cron/task/parametrized.php index 1d2f449c58..1aeead0399 100644 --- a/phpBB/phpbb/cron/task/parametrized.php +++ b/phpBB/phpbb/cron/task/parametrized.php @@ -9,14 +9,6 @@ namespace phpbb\cron\task; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Parametrized cron task interface. * diff --git a/phpBB/phpbb/cron/task/task.php b/phpBB/phpbb/cron/task/task.php index 84218c4fc9..3ce3de9598 100644 --- a/phpBB/phpbb/cron/task/task.php +++ b/phpBB/phpbb/cron/task/task.php @@ -9,14 +9,6 @@ namespace phpbb\cron\task; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Cron task interface * @package phpBB3 diff --git a/phpBB/phpbb/cron/task/wrapper.php b/phpBB/phpbb/cron/task/wrapper.php index aa015966c6..fc3f897206 100644 --- a/phpBB/phpbb/cron/task/wrapper.php +++ b/phpBB/phpbb/cron/task/wrapper.php @@ -9,14 +9,6 @@ namespace phpbb\cron\task; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Cron task wrapper class. * Enhances cron tasks with convenience methods that work identically for all tasks. diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php index 53d39e9127..58d0b61519 100644 --- a/phpBB/phpbb/db/driver/driver.php +++ b/phpBB/phpbb/db/driver/driver.php @@ -9,14 +9,6 @@ namespace phpbb\db\driver; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Database Abstraction Layer * @package dbal diff --git a/phpBB/phpbb/db/driver/firebird.php b/phpBB/phpbb/db/driver/firebird.php index aef75eab15..ed56a5d154 100644 --- a/phpBB/phpbb/db/driver/firebird.php +++ b/phpBB/phpbb/db/driver/firebird.php @@ -9,14 +9,6 @@ namespace phpbb\db\driver; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Firebird/Interbase Database Abstraction Layer * Minimum Requirement is Firebird 2.1 diff --git a/phpBB/phpbb/db/driver/mssql.php b/phpBB/phpbb/db/driver/mssql.php index e1b41461e2..6ebc891673 100644 --- a/phpBB/phpbb/db/driver/mssql.php +++ b/phpBB/phpbb/db/driver/mssql.php @@ -9,14 +9,6 @@ namespace phpbb\db\driver; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * MSSQL Database Abstraction Layer * Minimum Requirement is MSSQL 2000+ diff --git a/phpBB/phpbb/db/driver/mssql_base.php b/phpBB/phpbb/db/driver/mssql_base.php index 57c4e0f1fd..113f1c6902 100644 --- a/phpBB/phpbb/db/driver/mssql_base.php +++ b/phpBB/phpbb/db/driver/mssql_base.php @@ -9,14 +9,6 @@ namespace phpbb\db\driver; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * MSSQL Database Base Abstraction Layer * @package dbal diff --git a/phpBB/phpbb/db/driver/mssql_odbc.php b/phpBB/phpbb/db/driver/mssql_odbc.php index b9881035c0..f8c70f1cd7 100644 --- a/phpBB/phpbb/db/driver/mssql_odbc.php +++ b/phpBB/phpbb/db/driver/mssql_odbc.php @@ -9,14 +9,6 @@ namespace phpbb\db\driver; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Unified ODBC functions * Unified ODBC functions support any database having ODBC driver, for example Adabas D, IBM DB2, iODBC, Solid, Sybase SQL Anywhere... diff --git a/phpBB/phpbb/db/driver/mssqlnative.php b/phpBB/phpbb/db/driver/mssqlnative.php index 2eb625fb11..76cbd59d93 100644 --- a/phpBB/phpbb/db/driver/mssqlnative.php +++ b/phpBB/phpbb/db/driver/mssqlnative.php @@ -13,14 +13,6 @@ namespace phpbb\db\driver; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Prior to version 1.1 the SQL Server Native PHP driver didn't support sqlsrv_num_rows, or cursor based seeking so we recall all rows into an array * and maintain our own cursor index into that array. diff --git a/phpBB/phpbb/db/driver/mysql.php b/phpBB/phpbb/db/driver/mysql.php index d215453ccb..e311f0dd74 100644 --- a/phpBB/phpbb/db/driver/mysql.php +++ b/phpBB/phpbb/db/driver/mysql.php @@ -9,14 +9,6 @@ namespace phpbb\db\driver; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * MySQL4 Database Abstraction Layer * Compatible with: diff --git a/phpBB/phpbb/db/driver/mysql_base.php b/phpBB/phpbb/db/driver/mysql_base.php index 8f2f66674b..87b6d153a9 100644 --- a/phpBB/phpbb/db/driver/mysql_base.php +++ b/phpBB/phpbb/db/driver/mysql_base.php @@ -9,14 +9,6 @@ namespace phpbb\db\driver; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Abstract MySQL Database Base Abstraction Layer * @package dbal diff --git a/phpBB/phpbb/db/driver/mysqli.php b/phpBB/phpbb/db/driver/mysqli.php index aeb66c00cd..adc8f96302 100644 --- a/phpBB/phpbb/db/driver/mysqli.php +++ b/phpBB/phpbb/db/driver/mysqli.php @@ -9,14 +9,6 @@ namespace phpbb\db\driver; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * MySQLi Database Abstraction Layer * mysqli-extension has to be compiled with: diff --git a/phpBB/phpbb/db/driver/oracle.php b/phpBB/phpbb/db/driver/oracle.php index 4fba654d1e..36ed43d4a7 100644 --- a/phpBB/phpbb/db/driver/oracle.php +++ b/phpBB/phpbb/db/driver/oracle.php @@ -9,14 +9,6 @@ namespace phpbb\db\driver; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Oracle Database Abstraction Layer * @package dbal diff --git a/phpBB/phpbb/db/driver/postgres.php b/phpBB/phpbb/db/driver/postgres.php index 5cd6578d87..5dbd1ca74f 100644 --- a/phpBB/phpbb/db/driver/postgres.php +++ b/phpBB/phpbb/db/driver/postgres.php @@ -9,14 +9,6 @@ namespace phpbb\db\driver; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * PostgreSQL Database Abstraction Layer * Minimum Requirement is Version 7.3+ diff --git a/phpBB/phpbb/db/driver/sqlite.php b/phpBB/phpbb/db/driver/sqlite.php index 55a33284f2..59ec895c0f 100644 --- a/phpBB/phpbb/db/driver/sqlite.php +++ b/phpBB/phpbb/db/driver/sqlite.php @@ -9,14 +9,6 @@ namespace phpbb\db\driver; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Sqlite Database Abstraction Layer * Minimum Requirement: 2.8.2+ diff --git a/phpBB/phpbb/db/migration/exception.php b/phpBB/phpbb/db/migration/exception.php index 58e29b5218..cfe546d1ab 100644 --- a/phpBB/phpbb/db/migration/exception.php +++ b/phpBB/phpbb/db/migration/exception.php @@ -9,14 +9,6 @@ namespace phpbb\db\migration; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * The migrator is responsible for applying new migrations in the correct order. * diff --git a/phpBB/phpbb/db/migration/migration.php b/phpBB/phpbb/db/migration/migration.php index aff3837279..b32de00871 100644 --- a/phpBB/phpbb/db/migration/migration.php +++ b/phpBB/phpbb/db/migration/migration.php @@ -9,14 +9,6 @@ namespace phpbb\db\migration; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Abstract base class for database migrations * diff --git a/phpBB/phpbb/db/migrator.php b/phpBB/phpbb/db/migrator.php index 47e1406043..3b966b7fe3 100644 --- a/phpBB/phpbb/db/migrator.php +++ b/phpBB/phpbb/db/migrator.php @@ -9,14 +9,6 @@ namespace phpbb\db; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * The migrator is responsible for applying new migrations in the correct order. * diff --git a/phpBB/phpbb/db/sql_insert_buffer.php b/phpBB/phpbb/db/sql_insert_buffer.php index 7bbd213bdc..41026ad425 100644 --- a/phpBB/phpbb/db/sql_insert_buffer.php +++ b/phpBB/phpbb/db/sql_insert_buffer.php @@ -9,14 +9,6 @@ namespace phpbb\db; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Collects rows for insert into a database until the buffer size is reached. * Then flushes the buffer to the database and starts over again. diff --git a/phpBB/phpbb/db/tools.php b/phpBB/phpbb/db/tools.php index d9bd8cf568..4360c89ac3 100644 --- a/phpBB/phpbb/db/tools.php +++ b/phpBB/phpbb/db/tools.php @@ -9,14 +9,6 @@ namespace phpbb\db; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Database Tools for handling cross-db actions such as altering columns, etc. * Currently not supported is returning SQL for creating tables. diff --git a/phpBB/phpbb/di/extension/config.php b/phpBB/phpbb/di/extension/config.php index 85b374a3ca..5fcb2d6f10 100644 --- a/phpBB/phpbb/di/extension/config.php +++ b/phpBB/phpbb/di/extension/config.php @@ -9,14 +9,6 @@ namespace phpbb\di\extension; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\DependencyInjection\Extension; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; diff --git a/phpBB/phpbb/di/extension/core.php b/phpBB/phpbb/di/extension/core.php index 1f6b700973..455dfa7ecd 100644 --- a/phpBB/phpbb/di/extension/core.php +++ b/phpBB/phpbb/di/extension/core.php @@ -9,14 +9,6 @@ namespace phpbb\di\extension; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\DependencyInjection\Extension; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; diff --git a/phpBB/phpbb/di/extension/ext.php b/phpBB/phpbb/di/extension/ext.php index cf623a7c87..4f2f24cb1a 100644 --- a/phpBB/phpbb/di/extension/ext.php +++ b/phpBB/phpbb/di/extension/ext.php @@ -9,14 +9,6 @@ namespace phpbb\di\extension; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\DependencyInjection\Extension; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; diff --git a/phpBB/phpbb/di/pass/collection_pass.php b/phpBB/phpbb/di/pass/collection_pass.php index ffc5a41f6d..507271de3e 100644 --- a/phpBB/phpbb/di/pass/collection_pass.php +++ b/phpBB/phpbb/di/pass/collection_pass.php @@ -9,14 +9,6 @@ namespace phpbb\di\pass; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; diff --git a/phpBB/phpbb/di/pass/kernel_pass.php b/phpBB/phpbb/di/pass/kernel_pass.php index 6a9124ad78..9c2b193361 100644 --- a/phpBB/phpbb/di/pass/kernel_pass.php +++ b/phpBB/phpbb/di/pass/kernel_pass.php @@ -9,14 +9,6 @@ namespace phpbb\di\pass; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; diff --git a/phpBB/phpbb/di/service_collection.php b/phpBB/phpbb/di/service_collection.php index fccdd77071..65df9ab1d1 100644 --- a/phpBB/phpbb/di/service_collection.php +++ b/phpBB/phpbb/di/service_collection.php @@ -9,14 +9,6 @@ namespace phpbb\di; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/phpBB/phpbb/error_collector.php b/phpBB/phpbb/error_collector.php index 9b3216e32f..297972c6b8 100644 --- a/phpBB/phpbb/error_collector.php +++ b/phpBB/phpbb/error_collector.php @@ -9,14 +9,6 @@ namespace phpbb; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class error_collector { var $errors; diff --git a/phpBB/phpbb/event/data.php b/phpBB/phpbb/event/data.php index 3481023b74..bd1e0ae9ed 100644 --- a/phpBB/phpbb/event/data.php +++ b/phpBB/phpbb/event/data.php @@ -9,14 +9,6 @@ namespace phpbb\event; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - use Symfony\Component\EventDispatcher\Event; class data extends Event implements \ArrayAccess diff --git a/phpBB/phpbb/event/dispatcher.php b/phpBB/phpbb/event/dispatcher.php index cc3733692e..74b35eb78d 100644 --- a/phpBB/phpbb/event/dispatcher.php +++ b/phpBB/phpbb/event/dispatcher.php @@ -9,14 +9,6 @@ namespace phpbb\event; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - use Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher; /** diff --git a/phpBB/phpbb/event/extension_subscriber_loader.php b/phpBB/phpbb/event/extension_subscriber_loader.php index ab50a589fe..df8e093f4a 100644 --- a/phpBB/phpbb/event/extension_subscriber_loader.php +++ b/phpBB/phpbb/event/extension_subscriber_loader.php @@ -9,14 +9,6 @@ namespace phpbb\event; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - use Symfony\Component\EventDispatcher\EventDispatcherInterface; class extension_subscriber_loader diff --git a/phpBB/phpbb/event/kernel_exception_subscriber.php b/phpBB/phpbb/event/kernel_exception_subscriber.php index 7003e73b38..8a4de1fbad 100644 --- a/phpBB/phpbb/event/kernel_exception_subscriber.php +++ b/phpBB/phpbb/event/kernel_exception_subscriber.php @@ -9,14 +9,6 @@ namespace phpbb\event; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; diff --git a/phpBB/phpbb/event/kernel_request_subscriber.php b/phpBB/phpbb/event/kernel_request_subscriber.php index a629dd8440..7d5418498b 100644 --- a/phpBB/phpbb/event/kernel_request_subscriber.php +++ b/phpBB/phpbb/event/kernel_request_subscriber.php @@ -9,14 +9,6 @@ namespace phpbb\event; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\Event\GetResponseEvent; diff --git a/phpBB/phpbb/event/kernel_terminate_subscriber.php b/phpBB/phpbb/event/kernel_terminate_subscriber.php index de441da102..32dba322d1 100644 --- a/phpBB/phpbb/event/kernel_terminate_subscriber.php +++ b/phpBB/phpbb/event/kernel_terminate_subscriber.php @@ -9,14 +9,6 @@ namespace phpbb\event; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\Event\PostResponseEvent; diff --git a/phpBB/phpbb/extension/base.php b/phpBB/phpbb/extension/base.php index a529cc7961..1f871750e0 100644 --- a/phpBB/phpbb/extension/base.php +++ b/phpBB/phpbb/extension/base.php @@ -9,14 +9,6 @@ namespace phpbb\extension; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/phpBB/phpbb/extension/exception.php b/phpBB/phpbb/extension/exception.php index e2ba647878..b1f4997fdd 100644 --- a/phpBB/phpbb/extension/exception.php +++ b/phpBB/phpbb/extension/exception.php @@ -9,14 +9,6 @@ namespace phpbb\extension; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Exception class for metadata */ diff --git a/phpBB/phpbb/extension/extension_interface.php b/phpBB/phpbb/extension/extension_interface.php index 1e5f546dc5..bddff51b5a 100644 --- a/phpBB/phpbb/extension/extension_interface.php +++ b/phpBB/phpbb/extension/extension_interface.php @@ -9,14 +9,6 @@ namespace phpbb\extension; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * The interface extension meta classes have to implement to run custom code * on enable/disable/purge. diff --git a/phpBB/phpbb/extension/finder.php b/phpBB/phpbb/extension/finder.php index e787919588..c9c16ae6d5 100644 --- a/phpBB/phpbb/extension/finder.php +++ b/phpBB/phpbb/extension/finder.php @@ -9,14 +9,6 @@ namespace phpbb\extension; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * The extension finder provides a simple way to locate files in active extensions * diff --git a/phpBB/phpbb/extension/manager.php b/phpBB/phpbb/extension/manager.php index f8beb963ba..7f009867c9 100644 --- a/phpBB/phpbb/extension/manager.php +++ b/phpBB/phpbb/extension/manager.php @@ -9,14 +9,6 @@ namespace phpbb\extension; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/phpBB/phpbb/extension/metadata_manager.php b/phpBB/phpbb/extension/metadata_manager.php index ff5d55c7f2..fa46d70bc8 100644 --- a/phpBB/phpbb/extension/metadata_manager.php +++ b/phpBB/phpbb/extension/metadata_manager.php @@ -9,14 +9,6 @@ namespace phpbb\extension; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * The extension metadata manager validates and gets meta-data for extensions * diff --git a/phpBB/phpbb/extension/provider.php b/phpBB/phpbb/extension/provider.php index c2a264d311..bfdc2b66b9 100644 --- a/phpBB/phpbb/extension/provider.php +++ b/phpBB/phpbb/extension/provider.php @@ -9,14 +9,6 @@ namespace phpbb\extension; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Provides a set of items found in extensions. * diff --git a/phpBB/phpbb/feed/base.php b/phpBB/phpbb/feed/base.php index 8245b849a1..e6c1e606fa 100644 --- a/phpBB/phpbb/feed/base.php +++ b/phpBB/phpbb/feed/base.php @@ -9,14 +9,6 @@ namespace phpbb\feed; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Base class with some generic functions and settings. * diff --git a/phpBB/phpbb/feed/factory.php b/phpBB/phpbb/feed/factory.php index e011b0e3a9..d370160563 100644 --- a/phpBB/phpbb/feed/factory.php +++ b/phpBB/phpbb/feed/factory.php @@ -9,14 +9,6 @@ namespace phpbb\feed; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Factory class to return correct object * @package phpBB3 diff --git a/phpBB/phpbb/feed/forum.php b/phpBB/phpbb/feed/forum.php index 83066d2d25..8026824ab7 100644 --- a/phpBB/phpbb/feed/forum.php +++ b/phpBB/phpbb/feed/forum.php @@ -9,14 +9,6 @@ namespace phpbb\feed; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Forum feed * diff --git a/phpBB/phpbb/feed/forums.php b/phpBB/phpbb/feed/forums.php index 6be1c68da8..ddbb0bf7b3 100644 --- a/phpBB/phpbb/feed/forums.php +++ b/phpBB/phpbb/feed/forums.php @@ -9,14 +9,6 @@ namespace phpbb\feed; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * 'All Forums' feed * diff --git a/phpBB/phpbb/feed/helper.php b/phpBB/phpbb/feed/helper.php index cf8328bd5e..3f2759b85e 100644 --- a/phpBB/phpbb/feed/helper.php +++ b/phpBB/phpbb/feed/helper.php @@ -9,14 +9,6 @@ namespace phpbb\feed; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Class with some helpful functions used in feeds * @package phpBB3 diff --git a/phpBB/phpbb/feed/news.php b/phpBB/phpbb/feed/news.php index 20017a3248..7888e73239 100644 --- a/phpBB/phpbb/feed/news.php +++ b/phpBB/phpbb/feed/news.php @@ -9,14 +9,6 @@ namespace phpbb\feed; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * News feed * diff --git a/phpBB/phpbb/feed/overall.php b/phpBB/phpbb/feed/overall.php index 8ee1f092ab..4545ba5c64 100644 --- a/phpBB/phpbb/feed/overall.php +++ b/phpBB/phpbb/feed/overall.php @@ -9,14 +9,6 @@ namespace phpbb\feed; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Board wide feed (aka overall feed) * diff --git a/phpBB/phpbb/feed/post_base.php b/phpBB/phpbb/feed/post_base.php index 5588ecadb0..42c5eea9e3 100644 --- a/phpBB/phpbb/feed/post_base.php +++ b/phpBB/phpbb/feed/post_base.php @@ -9,14 +9,6 @@ namespace phpbb\feed; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Abstract class for post based feeds * diff --git a/phpBB/phpbb/feed/topic.php b/phpBB/phpbb/feed/topic.php index 1eeb4fbe94..09f377dd10 100644 --- a/phpBB/phpbb/feed/topic.php +++ b/phpBB/phpbb/feed/topic.php @@ -9,14 +9,6 @@ namespace phpbb\feed; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Topic feed for a specific topic * diff --git a/phpBB/phpbb/feed/topic_base.php b/phpBB/phpbb/feed/topic_base.php index f05be9223e..7e28e67b82 100644 --- a/phpBB/phpbb/feed/topic_base.php +++ b/phpBB/phpbb/feed/topic_base.php @@ -9,14 +9,6 @@ namespace phpbb\feed; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Abstract class for topic based feeds * diff --git a/phpBB/phpbb/feed/topics.php b/phpBB/phpbb/feed/topics.php index d70195c87b..bdc858e947 100644 --- a/phpBB/phpbb/feed/topics.php +++ b/phpBB/phpbb/feed/topics.php @@ -9,14 +9,6 @@ namespace phpbb\feed; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * New Topics feed * diff --git a/phpBB/phpbb/feed/topics_active.php b/phpBB/phpbb/feed/topics_active.php index c6f46d67e6..cc0adac2eb 100644 --- a/phpBB/phpbb/feed/topics_active.php +++ b/phpBB/phpbb/feed/topics_active.php @@ -9,14 +9,6 @@ namespace phpbb\feed; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Active Topics feed * diff --git a/phpBB/phpbb/filesystem.php b/phpBB/phpbb/filesystem.php index dbfaebe0fa..7878be0a5e 100644 --- a/phpBB/phpbb/filesystem.php +++ b/phpBB/phpbb/filesystem.php @@ -9,14 +9,6 @@ namespace phpbb; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * A class with various functions that are related to paths, files and the filesystem * @package phpBB3 diff --git a/phpBB/phpbb/groupposition/exception.php b/phpBB/phpbb/groupposition/exception.php index 3a8d92dbc7..f43502235d 100644 --- a/phpBB/phpbb/groupposition/exception.php +++ b/phpBB/phpbb/groupposition/exception.php @@ -9,14 +9,6 @@ namespace phpbb\groupposition; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * @package groupposition */ diff --git a/phpBB/phpbb/groupposition/groupposition_interface.php b/phpBB/phpbb/groupposition/groupposition_interface.php index a568785185..9785172a00 100644 --- a/phpBB/phpbb/groupposition/groupposition_interface.php +++ b/phpBB/phpbb/groupposition/groupposition_interface.php @@ -9,14 +9,6 @@ namespace phpbb\groupposition; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Interface to manage group positions in various places of phpbb * diff --git a/phpBB/phpbb/groupposition/legend.php b/phpBB/phpbb/groupposition/legend.php index 9a1ef3d1d0..47ba06c006 100644 --- a/phpBB/phpbb/groupposition/legend.php +++ b/phpBB/phpbb/groupposition/legend.php @@ -9,14 +9,6 @@ namespace phpbb\groupposition; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Legend group position class * diff --git a/phpBB/phpbb/groupposition/teampage.php b/phpBB/phpbb/groupposition/teampage.php index 4e8228eb58..d934571ebc 100644 --- a/phpBB/phpbb/groupposition/teampage.php +++ b/phpBB/phpbb/groupposition/teampage.php @@ -9,14 +9,6 @@ namespace phpbb\groupposition; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Teampage group position class * diff --git a/phpBB/phpbb/hook/finder.php b/phpBB/phpbb/hook/finder.php index d5eb1f8186..c8f71861d9 100644 --- a/phpBB/phpbb/hook/finder.php +++ b/phpBB/phpbb/hook/finder.php @@ -9,14 +9,6 @@ namespace phpbb\hook; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * The hook finder locates installed hooks. * diff --git a/phpBB/phpbb/json_response.php b/phpBB/phpbb/json_response.php index fe532fc9d4..45c2f6cac4 100644 --- a/phpBB/phpbb/json_response.php +++ b/phpBB/phpbb/json_response.php @@ -9,14 +9,6 @@ namespace phpbb; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * JSON class * @package phpBB3 diff --git a/phpBB/phpbb/lock/db.php b/phpBB/phpbb/lock/db.php index 3e15727c12..461adda045 100644 --- a/phpBB/phpbb/lock/db.php +++ b/phpBB/phpbb/lock/db.php @@ -9,14 +9,6 @@ namespace phpbb\lock; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Database locking class * @package phpBB3 diff --git a/phpBB/phpbb/lock/flock.php b/phpBB/phpbb/lock/flock.php index 2a36a853ee..94a5895440 100644 --- a/phpBB/phpbb/lock/flock.php +++ b/phpBB/phpbb/lock/flock.php @@ -9,14 +9,6 @@ namespace phpbb\lock; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * File locking class * @package phpBB3 diff --git a/phpBB/phpbb/log/log.php b/phpBB/phpbb/log/log.php index 7f4e52ed39..a6ee06ebf2 100644 --- a/phpBB/phpbb/log/log.php +++ b/phpBB/phpbb/log/log.php @@ -9,14 +9,6 @@ namespace phpbb\log; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * This class is used to add entries into the log table. * diff --git a/phpBB/phpbb/log/log_interface.php b/phpBB/phpbb/log/log_interface.php index 427d30015d..420ba79691 100644 --- a/phpBB/phpbb/log/log_interface.php +++ b/phpBB/phpbb/log/log_interface.php @@ -9,14 +9,6 @@ namespace phpbb\log; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * The interface for the log-system. * diff --git a/phpBB/phpbb/log/null.php b/phpBB/phpbb/log/null.php index 2ef69926ee..77d0fbe2d7 100644 --- a/phpBB/phpbb/log/null.php +++ b/phpBB/phpbb/log/null.php @@ -9,14 +9,6 @@ namespace phpbb\log; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Null logger * diff --git a/phpBB/phpbb/notification/exception.php b/phpBB/phpbb/notification/exception.php index 275fb3b542..6bdded3fd8 100644 --- a/phpBB/phpbb/notification/exception.php +++ b/phpBB/phpbb/notification/exception.php @@ -9,14 +9,6 @@ namespace phpbb\notification; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Notifications exception * diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php index b92b247c74..a3c9425183 100644 --- a/phpBB/phpbb/notification/manager.php +++ b/phpBB/phpbb/notification/manager.php @@ -9,14 +9,6 @@ namespace phpbb\notification; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Notifications service class * @package notifications diff --git a/phpBB/phpbb/notification/method/base.php b/phpBB/phpbb/notification/method/base.php index 327f964424..4ce42de830 100644 --- a/phpBB/phpbb/notification/method/base.php +++ b/phpBB/phpbb/notification/method/base.php @@ -9,14 +9,6 @@ namespace phpbb\notification\method; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Base notifications method class * @package notifications diff --git a/phpBB/phpbb/notification/method/email.php b/phpBB/phpbb/notification/method/email.php index b761eb5a28..e039fae8de 100644 --- a/phpBB/phpbb/notification/method/email.php +++ b/phpBB/phpbb/notification/method/email.php @@ -9,14 +9,6 @@ namespace phpbb\notification\method; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Email notification method class * This class handles sending emails for notifications diff --git a/phpBB/phpbb/notification/method/jabber.php b/phpBB/phpbb/notification/method/jabber.php index 6ec21bb735..bdfaf5a6fc 100644 --- a/phpBB/phpbb/notification/method/jabber.php +++ b/phpBB/phpbb/notification/method/jabber.php @@ -9,14 +9,6 @@ namespace phpbb\notification\method; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Jabber notification method class * This class handles sending Jabber messages for notifications diff --git a/phpBB/phpbb/notification/method/messenger_base.php b/phpBB/phpbb/notification/method/messenger_base.php index b1b30f29b7..7cb38eb59d 100644 --- a/phpBB/phpbb/notification/method/messenger_base.php +++ b/phpBB/phpbb/notification/method/messenger_base.php @@ -9,14 +9,6 @@ namespace phpbb\notification\method; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Abstract notification method handling email and jabber notifications * using the phpBB messenger. diff --git a/phpBB/phpbb/notification/method/method_interface.php b/phpBB/phpbb/notification/method/method_interface.php index 0131a8bde0..4830d06b86 100644 --- a/phpBB/phpbb/notification/method/method_interface.php +++ b/phpBB/phpbb/notification/method/method_interface.php @@ -9,14 +9,6 @@ namespace phpbb\notification\method; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Base notifications method interface * @package notifications diff --git a/phpBB/phpbb/notification/type/approve_post.php b/phpBB/phpbb/notification/type/approve_post.php index cf4ec57989..51a9a704b0 100644 --- a/phpBB/phpbb/notification/type/approve_post.php +++ b/phpBB/phpbb/notification/type/approve_post.php @@ -9,14 +9,6 @@ namespace phpbb\notification\type; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Post approved notifications class * This class handles notifications for posts when they are approved (to their authors) diff --git a/phpBB/phpbb/notification/type/approve_topic.php b/phpBB/phpbb/notification/type/approve_topic.php index 9f061b8be1..6229800c68 100644 --- a/phpBB/phpbb/notification/type/approve_topic.php +++ b/phpBB/phpbb/notification/type/approve_topic.php @@ -9,14 +9,6 @@ namespace phpbb\notification\type; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Topic approved notifications class * This class handles notifications for topics when they are approved (for authors) diff --git a/phpBB/phpbb/notification/type/base.php b/phpBB/phpbb/notification/type/base.php index 3c44468bb8..951585853f 100644 --- a/phpBB/phpbb/notification/type/base.php +++ b/phpBB/phpbb/notification/type/base.php @@ -9,14 +9,6 @@ namespace phpbb\notification\type; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Base notifications class * @package notifications diff --git a/phpBB/phpbb/notification/type/bookmark.php b/phpBB/phpbb/notification/type/bookmark.php index 50ea7380af..5e6fdd2523 100644 --- a/phpBB/phpbb/notification/type/bookmark.php +++ b/phpBB/phpbb/notification/type/bookmark.php @@ -9,14 +9,6 @@ namespace phpbb\notification\type; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Bookmark updating notifications class * This class handles notifications for replies to a bookmarked topic diff --git a/phpBB/phpbb/notification/type/disapprove_post.php b/phpBB/phpbb/notification/type/disapprove_post.php index 0c9162ec5c..411d4195c7 100644 --- a/phpBB/phpbb/notification/type/disapprove_post.php +++ b/phpBB/phpbb/notification/type/disapprove_post.php @@ -9,14 +9,6 @@ namespace phpbb\notification\type; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Post disapproved notifications class * This class handles notifications for posts when they are disapproved (for authors) diff --git a/phpBB/phpbb/notification/type/disapprove_topic.php b/phpBB/phpbb/notification/type/disapprove_topic.php index dde6f83ec4..19e9d468ce 100644 --- a/phpBB/phpbb/notification/type/disapprove_topic.php +++ b/phpBB/phpbb/notification/type/disapprove_topic.php @@ -9,14 +9,6 @@ namespace phpbb\notification\type; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Topic disapproved notifications class * This class handles notifications for topics when they are disapproved (for authors) diff --git a/phpBB/phpbb/notification/type/group_request.php b/phpBB/phpbb/notification/type/group_request.php index 1768a8fffa..e0527fe220 100644 --- a/phpBB/phpbb/notification/type/group_request.php +++ b/phpBB/phpbb/notification/type/group_request.php @@ -9,14 +9,6 @@ namespace phpbb\notification\type; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class group_request extends \phpbb\notification\type\base { /** diff --git a/phpBB/phpbb/notification/type/group_request_approved.php b/phpBB/phpbb/notification/type/group_request_approved.php index be4a902acd..448f049412 100644 --- a/phpBB/phpbb/notification/type/group_request_approved.php +++ b/phpBB/phpbb/notification/type/group_request_approved.php @@ -9,14 +9,6 @@ namespace phpbb\notification\type; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class group_request_approved extends \phpbb\notification\type\base { /** diff --git a/phpBB/phpbb/notification/type/pm.php b/phpBB/phpbb/notification/type/pm.php index bed0807b0f..584a30efa6 100644 --- a/phpBB/phpbb/notification/type/pm.php +++ b/phpBB/phpbb/notification/type/pm.php @@ -9,14 +9,6 @@ namespace phpbb\notification\type; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Private message notifications class * This class handles notifications for private messages diff --git a/phpBB/phpbb/notification/type/post.php b/phpBB/phpbb/notification/type/post.php index fe50e7f172..9d5c7b0a4c 100644 --- a/phpBB/phpbb/notification/type/post.php +++ b/phpBB/phpbb/notification/type/post.php @@ -9,14 +9,6 @@ namespace phpbb\notification\type; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Post notifications class * This class handles notifications for replies to a topic diff --git a/phpBB/phpbb/notification/type/post_in_queue.php b/phpBB/phpbb/notification/type/post_in_queue.php index f05ed1ce9a..db16763583 100644 --- a/phpBB/phpbb/notification/type/post_in_queue.php +++ b/phpBB/phpbb/notification/type/post_in_queue.php @@ -9,14 +9,6 @@ namespace phpbb\notification\type; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Post in queue notifications class * This class handles notifications for posts that are put in the moderation queue (for moderators) diff --git a/phpBB/phpbb/notification/type/quote.php b/phpBB/phpbb/notification/type/quote.php index 8fb433990e..e8527261d8 100644 --- a/phpBB/phpbb/notification/type/quote.php +++ b/phpBB/phpbb/notification/type/quote.php @@ -9,14 +9,6 @@ namespace phpbb\notification\type; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Post quoting notifications class * This class handles notifying users when they have been quoted in a post diff --git a/phpBB/phpbb/notification/type/report_pm.php b/phpBB/phpbb/notification/type/report_pm.php index 13330e2932..55f6bf946d 100644 --- a/phpBB/phpbb/notification/type/report_pm.php +++ b/phpBB/phpbb/notification/type/report_pm.php @@ -9,14 +9,6 @@ namespace phpbb\notification\type; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Private message reported notifications class * This class handles notifications for private messages when they are reported diff --git a/phpBB/phpbb/notification/type/report_pm_closed.php b/phpBB/phpbb/notification/type/report_pm_closed.php index 2e4a1ceb30..9d2aac329e 100644 --- a/phpBB/phpbb/notification/type/report_pm_closed.php +++ b/phpBB/phpbb/notification/type/report_pm_closed.php @@ -9,14 +9,6 @@ namespace phpbb\notification\type; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * PM report closed notifications class * This class handles notifications for when reports are closed on PMs (for the one who reported the PM) diff --git a/phpBB/phpbb/notification/type/report_post.php b/phpBB/phpbb/notification/type/report_post.php index c2dad6f1bb..89b497efa6 100644 --- a/phpBB/phpbb/notification/type/report_post.php +++ b/phpBB/phpbb/notification/type/report_post.php @@ -9,14 +9,6 @@ namespace phpbb\notification\type; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Reported post notifications class * This class handles notifications for reported posts diff --git a/phpBB/phpbb/notification/type/report_post_closed.php b/phpBB/phpbb/notification/type/report_post_closed.php index 270ccf0a1a..5874d48e31 100644 --- a/phpBB/phpbb/notification/type/report_post_closed.php +++ b/phpBB/phpbb/notification/type/report_post_closed.php @@ -9,14 +9,6 @@ namespace phpbb\notification\type; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Post report closed notifications class * This class handles notifications for when reports are closed on posts (for the one who reported the post) diff --git a/phpBB/phpbb/notification/type/topic.php b/phpBB/phpbb/notification/type/topic.php index 8db02f610b..6198881d8d 100644 --- a/phpBB/phpbb/notification/type/topic.php +++ b/phpBB/phpbb/notification/type/topic.php @@ -9,14 +9,6 @@ namespace phpbb\notification\type; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Topic notifications class * This class handles notifications for new topics diff --git a/phpBB/phpbb/notification/type/topic_in_queue.php b/phpBB/phpbb/notification/type/topic_in_queue.php index 056651bc53..c8c1b5b7e2 100644 --- a/phpBB/phpbb/notification/type/topic_in_queue.php +++ b/phpBB/phpbb/notification/type/topic_in_queue.php @@ -9,14 +9,6 @@ namespace phpbb\notification\type; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Topic in queue notifications class * This class handles notifications for topics when they are put in the moderation queue (for moderators) diff --git a/phpBB/phpbb/notification/type/type_interface.php b/phpBB/phpbb/notification/type/type_interface.php index cfc6cd461e..e3e6898172 100644 --- a/phpBB/phpbb/notification/type/type_interface.php +++ b/phpBB/phpbb/notification/type/type_interface.php @@ -9,14 +9,6 @@ namespace phpbb\notification\type; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Base notifications interface * @package notifications diff --git a/phpBB/phpbb/path_helper.php b/phpBB/phpbb/path_helper.php index e9fd092b62..8cd8808261 100644 --- a/phpBB/phpbb/path_helper.php +++ b/phpBB/phpbb/path_helper.php @@ -9,14 +9,6 @@ namespace phpbb; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * A class with various functions that are related to paths, files and the filesystem * @package phpBB3 diff --git a/phpBB/phpbb/permissions.php b/phpBB/phpbb/permissions.php index d0405471bc..8319e6d123 100644 --- a/phpBB/phpbb/permissions.php +++ b/phpBB/phpbb/permissions.php @@ -9,14 +9,6 @@ namespace phpbb; -/** -* DO NOT CHANGE -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class permissions { /** diff --git a/phpBB/phpbb/php/ini.php b/phpBB/phpbb/php/ini.php index 8767091aba..f0f53807fe 100644 --- a/phpBB/phpbb/php/ini.php +++ b/phpBB/phpbb/php/ini.php @@ -9,14 +9,6 @@ namespace phpbb\php; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Wrapper class for ini_get function. * diff --git a/phpBB/phpbb/plupload/plupload.php b/phpBB/phpbb/plupload/plupload.php index 6eb5adf864..f21ec40450 100644 --- a/phpBB/phpbb/plupload/plupload.php +++ b/phpBB/phpbb/plupload/plupload.php @@ -9,14 +9,6 @@ namespace phpbb\plupload; -/** - * @ignore - */ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * This class handles all server-side plupload functions * diff --git a/phpBB/phpbb/request/deactivated_super_global.php b/phpBB/phpbb/request/deactivated_super_global.php index 8f39960477..b03624593e 100644 --- a/phpBB/phpbb/request/deactivated_super_global.php +++ b/phpBB/phpbb/request/deactivated_super_global.php @@ -9,14 +9,6 @@ namespace phpbb\request; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Replacement for a superglobal (like $_GET or $_POST) which calls * trigger_error on all operations but isset, overloads the [] operator with SPL. diff --git a/phpBB/phpbb/request/request.php b/phpBB/phpbb/request/request.php index 1c388b3c73..e158d33c01 100644 --- a/phpBB/phpbb/request/request.php +++ b/phpBB/phpbb/request/request.php @@ -9,14 +9,6 @@ namespace phpbb\request; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * All application input is accessed through this class. * diff --git a/phpBB/phpbb/request/request_interface.php b/phpBB/phpbb/request/request_interface.php index cd949147f7..1f9978b276 100644 --- a/phpBB/phpbb/request/request_interface.php +++ b/phpBB/phpbb/request/request_interface.php @@ -9,14 +9,6 @@ namespace phpbb\request; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * An interface through which all application input can be accessed. * diff --git a/phpBB/phpbb/request/type_cast_helper.php b/phpBB/phpbb/request/type_cast_helper.php index 262aff73c1..e9b55663af 100644 --- a/phpBB/phpbb/request/type_cast_helper.php +++ b/phpBB/phpbb/request/type_cast_helper.php @@ -9,14 +9,6 @@ namespace phpbb\request; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * A helper class that provides convenience methods for type casting. * diff --git a/phpBB/phpbb/request/type_cast_helper_interface.php b/phpBB/phpbb/request/type_cast_helper_interface.php index e8195c352e..f12795eef9 100644 --- a/phpBB/phpbb/request/type_cast_helper_interface.php +++ b/phpBB/phpbb/request/type_cast_helper_interface.php @@ -9,14 +9,6 @@ namespace phpbb\request; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * An interface for type cast operations. * diff --git a/phpBB/phpbb/search/base.php b/phpBB/phpbb/search/base.php index f2f982c31b..9ecf3751d0 100644 --- a/phpBB/phpbb/search/base.php +++ b/phpBB/phpbb/search/base.php @@ -9,14 +9,6 @@ namespace phpbb\search; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * @ignore */ diff --git a/phpBB/phpbb/search/fulltext_mysql.php b/phpBB/phpbb/search/fulltext_mysql.php index ca2f42358f..cdd2da222f 100644 --- a/phpBB/phpbb/search/fulltext_mysql.php +++ b/phpBB/phpbb/search/fulltext_mysql.php @@ -9,14 +9,6 @@ namespace phpbb\search; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * fulltext_mysql * Fulltext search for MySQL diff --git a/phpBB/phpbb/search/fulltext_native.php b/phpBB/phpbb/search/fulltext_native.php index 024b8f441b..f3bb94a0c5 100644 --- a/phpBB/phpbb/search/fulltext_native.php +++ b/phpBB/phpbb/search/fulltext_native.php @@ -9,14 +9,6 @@ namespace phpbb\search; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * fulltext_native * phpBB's own db driven fulltext search, version 2 diff --git a/phpBB/phpbb/search/fulltext_postgres.php b/phpBB/phpbb/search/fulltext_postgres.php index 756034103e..063bf52a19 100644 --- a/phpBB/phpbb/search/fulltext_postgres.php +++ b/phpBB/phpbb/search/fulltext_postgres.php @@ -9,14 +9,6 @@ namespace phpbb\search; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * fulltext_postgres * Fulltext search for PostgreSQL diff --git a/phpBB/phpbb/search/fulltext_sphinx.php b/phpBB/phpbb/search/fulltext_sphinx.php index cb76d58f49..acbfad9474 100644 --- a/phpBB/phpbb/search/fulltext_sphinx.php +++ b/phpBB/phpbb/search/fulltext_sphinx.php @@ -9,16 +9,6 @@ namespace phpbb\search; -/** -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - -/** -* @ignore -*/ define('SPHINX_MAX_MATCHES', 20000); define('SPHINX_CONNECT_RETRIES', 3); define('SPHINX_CONNECT_WAIT_TIME', 300); diff --git a/phpBB/phpbb/search/sphinx/config.php b/phpBB/phpbb/search/sphinx/config.php index 262d6008cc..cb8e4524df 100644 --- a/phpBB/phpbb/search/sphinx/config.php +++ b/phpBB/phpbb/search/sphinx/config.php @@ -9,14 +9,6 @@ namespace phpbb\search\sphinx; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * \phpbb\search\sphinx\config * An object representing the sphinx configuration diff --git a/phpBB/phpbb/search/sphinx/config_comment.php b/phpBB/phpbb/search/sphinx/config_comment.php index 77a943377d..20b1c19af1 100644 --- a/phpBB/phpbb/search/sphinx/config_comment.php +++ b/phpBB/phpbb/search/sphinx/config_comment.php @@ -9,14 +9,6 @@ namespace phpbb\search\sphinx; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * \phpbb\search\sphinx\config_comment * Represents a comment inside the sphinx configuration diff --git a/phpBB/phpbb/search/sphinx/config_section.php b/phpBB/phpbb/search/sphinx/config_section.php index 730abf011e..8f9253ec56 100644 --- a/phpBB/phpbb/search/sphinx/config_section.php +++ b/phpBB/phpbb/search/sphinx/config_section.php @@ -9,14 +9,6 @@ namespace phpbb\search\sphinx; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * \phpbb\search\sphinx\config_section * Represents a single section inside the sphinx configuration diff --git a/phpBB/phpbb/search/sphinx/config_variable.php b/phpBB/phpbb/search/sphinx/config_variable.php index c8f40bfb5f..c0f6d28dcc 100644 --- a/phpBB/phpbb/search/sphinx/config_variable.php +++ b/phpBB/phpbb/search/sphinx/config_variable.php @@ -9,14 +9,6 @@ namespace phpbb\search\sphinx; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * \phpbb\search\sphinx\config_variable * Represents a single variable inside the sphinx configuration diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php index 214ab8fd33..f530d30f1f 100644 --- a/phpBB/phpbb/session.php +++ b/phpBB/phpbb/session.php @@ -9,14 +9,6 @@ namespace phpbb; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Session class * @package phpBB3 diff --git a/phpBB/phpbb/symfony_request.php b/phpBB/phpbb/symfony_request.php index 92784c213b..ebe862a565 100644 --- a/phpBB/phpbb/symfony_request.php +++ b/phpBB/phpbb/symfony_request.php @@ -11,14 +11,6 @@ namespace phpbb; use Symfony\Component\HttpFoundation\Request; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class symfony_request extends Request { /** diff --git a/phpBB/phpbb/template/asset.php b/phpBB/phpbb/template/asset.php index 27564bf347..24e0d6698d 100644 --- a/phpBB/phpbb/template/asset.php +++ b/phpBB/phpbb/template/asset.php @@ -9,14 +9,6 @@ namespace phpbb\template; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class asset { protected $components = array(); diff --git a/phpBB/phpbb/template/base.php b/phpBB/phpbb/template/base.php index 86868707f0..6044effa1f 100644 --- a/phpBB/phpbb/template/base.php +++ b/phpBB/phpbb/template/base.php @@ -9,14 +9,6 @@ namespace phpbb\template; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - abstract class base implements template { /** diff --git a/phpBB/phpbb/template/context.php b/phpBB/phpbb/template/context.php index decd1c7956..65c7d094a0 100644 --- a/phpBB/phpbb/template/context.php +++ b/phpBB/phpbb/template/context.php @@ -9,14 +9,6 @@ namespace phpbb\template; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Stores variables assigned to template. * diff --git a/phpBB/phpbb/template/template.php b/phpBB/phpbb/template/template.php index cf38bba522..d95b0a822c 100644 --- a/phpBB/phpbb/template/template.php +++ b/phpBB/phpbb/template/template.php @@ -9,14 +9,6 @@ namespace phpbb\template; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - interface template { diff --git a/phpBB/phpbb/template/twig/definition.php b/phpBB/phpbb/template/twig/definition.php index 2490a43f81..945c46675e 100644 --- a/phpBB/phpbb/template/twig/definition.php +++ b/phpBB/phpbb/template/twig/definition.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * This class holds all DEFINE variables from the current page load */ diff --git a/phpBB/phpbb/template/twig/environment.php b/phpBB/phpbb/template/twig/environment.php index a6c0e476f0..24bd55b3c5 100644 --- a/phpBB/phpbb/template/twig/environment.php +++ b/phpBB/phpbb/template/twig/environment.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class environment extends \Twig_Environment { /** @var array */ diff --git a/phpBB/phpbb/template/twig/extension.php b/phpBB/phpbb/template/twig/extension.php index 1ddb97369e..c9d2ab5799 100644 --- a/phpBB/phpbb/template/twig/extension.php +++ b/phpBB/phpbb/template/twig/extension.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class extension extends \Twig_Extension { /** @var \phpbb\template\context */ diff --git a/phpBB/phpbb/template/twig/lexer.php b/phpBB/phpbb/template/twig/lexer.php index d832fbf84e..be53b3eb5b 100644 --- a/phpBB/phpbb/template/twig/lexer.php +++ b/phpBB/phpbb/template/twig/lexer.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class lexer extends \Twig_Lexer { public function tokenize($code, $filename = null) diff --git a/phpBB/phpbb/template/twig/loader.php b/phpBB/phpbb/template/twig/loader.php index 910061dc0f..e01e9de467 100644 --- a/phpBB/phpbb/template/twig/loader.php +++ b/phpBB/phpbb/template/twig/loader.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Twig Template loader * @package phpBB3 diff --git a/phpBB/phpbb/template/twig/node/definenode.php b/phpBB/phpbb/template/twig/node/definenode.php index ec084d0f7d..6a9969f8c6 100644 --- a/phpBB/phpbb/template/twig/node/definenode.php +++ b/phpBB/phpbb/template/twig/node/definenode.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig\node; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class definenode extends \Twig_Node { diff --git a/phpBB/phpbb/template/twig/node/event.php b/phpBB/phpbb/template/twig/node/event.php index 202db775ee..a8d4d06333 100644 --- a/phpBB/phpbb/template/twig/node/event.php +++ b/phpBB/phpbb/template/twig/node/event.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig\node; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class event extends \Twig_Node { diff --git a/phpBB/phpbb/template/twig/node/expression/binary/equalequal.php b/phpBB/phpbb/template/twig/node/expression/binary/equalequal.php index 48d8b814b8..f3bbfa6691 100644 --- a/phpBB/phpbb/template/twig/node/expression/binary/equalequal.php +++ b/phpBB/phpbb/template/twig/node/expression/binary/equalequal.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig\node\expression\binary; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class equalequal extends \Twig_Node_Expression_Binary { diff --git a/phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php b/phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php index 87585dfb4c..c9c2687e08 100644 --- a/phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php +++ b/phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig\node\expression\binary; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class notequalequal extends \Twig_Node_Expression_Binary { diff --git a/phpBB/phpbb/template/twig/node/includenode.php b/phpBB/phpbb/template/twig/node/includenode.php index 77fe7f3acb..d9b45d6407 100644 --- a/phpBB/phpbb/template/twig/node/includenode.php +++ b/phpBB/phpbb/template/twig/node/includenode.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig\node; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class includenode extends \Twig_Node_Include { diff --git a/phpBB/phpbb/template/twig/node/includephp.php b/phpBB/phpbb/template/twig/node/includephp.php index 1d3e51f54a..3f4621c0a9 100644 --- a/phpBB/phpbb/template/twig/node/includephp.php +++ b/phpBB/phpbb/template/twig/node/includephp.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig\node; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class includephp extends \Twig_Node { diff --git a/phpBB/phpbb/template/twig/node/php.php b/phpBB/phpbb/template/twig/node/php.php index b37759303d..2b18551266 100644 --- a/phpBB/phpbb/template/twig/node/php.php +++ b/phpBB/phpbb/template/twig/node/php.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig\node; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class php extends \Twig_Node { diff --git a/phpBB/phpbb/template/twig/tokenparser/defineparser.php b/phpBB/phpbb/template/twig/tokenparser/defineparser.php index 688afec191..21add0c17c 100644 --- a/phpBB/phpbb/template/twig/tokenparser/defineparser.php +++ b/phpBB/phpbb/template/twig/tokenparser/defineparser.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig\tokenparser; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class defineparser extends \Twig_TokenParser { diff --git a/phpBB/phpbb/template/twig/tokenparser/event.php b/phpBB/phpbb/template/twig/tokenparser/event.php index 7cf4000909..8864e879f8 100644 --- a/phpBB/phpbb/template/twig/tokenparser/event.php +++ b/phpBB/phpbb/template/twig/tokenparser/event.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig\tokenparser; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class event extends \Twig_TokenParser { diff --git a/phpBB/phpbb/template/twig/tokenparser/includejs.php b/phpBB/phpbb/template/twig/tokenparser/includejs.php index 30a99f3279..0e46915b86 100644 --- a/phpBB/phpbb/template/twig/tokenparser/includejs.php +++ b/phpBB/phpbb/template/twig/tokenparser/includejs.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig\tokenparser; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class includejs extends \Twig_TokenParser { diff --git a/phpBB/phpbb/template/twig/tokenparser/includeparser.php b/phpBB/phpbb/template/twig/tokenparser/includeparser.php index 715c0ec84d..d351f1b4cd 100644 --- a/phpBB/phpbb/template/twig/tokenparser/includeparser.php +++ b/phpBB/phpbb/template/twig/tokenparser/includeparser.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig\tokenparser; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class includeparser extends \Twig_TokenParser_Include { diff --git a/phpBB/phpbb/template/twig/tokenparser/includephp.php b/phpBB/phpbb/template/twig/tokenparser/includephp.php index 25170e7214..1b3d1742e3 100644 --- a/phpBB/phpbb/template/twig/tokenparser/includephp.php +++ b/phpBB/phpbb/template/twig/tokenparser/includephp.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig\tokenparser; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class includephp extends \Twig_TokenParser { diff --git a/phpBB/phpbb/template/twig/tokenparser/php.php b/phpBB/phpbb/template/twig/tokenparser/php.php index e4f70fb9b1..13688af2f6 100644 --- a/phpBB/phpbb/template/twig/tokenparser/php.php +++ b/phpBB/phpbb/template/twig/tokenparser/php.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig\tokenparser; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class php extends \Twig_TokenParser { diff --git a/phpBB/phpbb/template/twig/twig.php b/phpBB/phpbb/template/twig/twig.php index 9df9310427..ddadcfd89a 100644 --- a/phpBB/phpbb/template/twig/twig.php +++ b/phpBB/phpbb/template/twig/twig.php @@ -9,14 +9,6 @@ namespace phpbb\template\twig; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Twig Template class. * @package phpBB3 diff --git a/phpBB/phpbb/tree/nestedset.php b/phpBB/phpbb/tree/nestedset.php index 171dae4d14..13184cf41c 100644 --- a/phpBB/phpbb/tree/nestedset.php +++ b/phpBB/phpbb/tree/nestedset.php @@ -9,14 +9,6 @@ namespace phpbb\tree; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - abstract class nestedset implements \phpbb\tree\tree_interface { /** @var \phpbb\db\driver\driver */ diff --git a/phpBB/phpbb/tree/nestedset_forum.php b/phpBB/phpbb/tree/nestedset_forum.php index 2fee5b097e..ef6023546b 100644 --- a/phpBB/phpbb/tree/nestedset_forum.php +++ b/phpBB/phpbb/tree/nestedset_forum.php @@ -9,14 +9,6 @@ namespace phpbb\tree; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - class nestedset_forum extends \phpbb\tree\nestedset { /** diff --git a/phpBB/phpbb/tree/tree_interface.php b/phpBB/phpbb/tree/tree_interface.php index 162c1e5e29..90ec27e024 100644 --- a/phpBB/phpbb/tree/tree_interface.php +++ b/phpBB/phpbb/tree/tree_interface.php @@ -9,14 +9,6 @@ namespace phpbb\tree; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - interface tree_interface { /** diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php index d82acbf501..ce0dc3c1df 100644 --- a/phpBB/phpbb/user.php +++ b/phpBB/phpbb/user.php @@ -9,14 +9,6 @@ namespace phpbb; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Base user class * diff --git a/phpBB/phpbb/user_loader.php b/phpBB/phpbb/user_loader.php index 78620ab1b9..c1d69802f8 100644 --- a/phpBB/phpbb/user_loader.php +++ b/phpBB/phpbb/user_loader.php @@ -9,13 +9,6 @@ namespace phpbb; -/** -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * User loader class * -- cgit v1.2.1 From ef1f99183796f8e246f96bca54ca439bf8ea1750 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Wed, 30 Oct 2013 13:37:29 +0100 Subject: [task/code-sniffer] Replace spaces with tabs. PHPBB3-11980 --- phpBB/phpbb/class_loader.php | 2 +- phpBB/phpbb/datetime.php | 4 +- phpBB/phpbb/event/data.php | 92 +++++++++++++-------------- phpBB/phpbb/extension/metadata_manager.php | 62 +++++++++--------- phpBB/phpbb/notification/manager.php | 6 +- phpBB/phpbb/search/fulltext_native.php | 8 +-- phpBB/phpbb/template/twig/extension.php | 74 ++++++++++----------- phpBB/phpbb/template/twig/node/event.php | 10 +-- phpBB/phpbb/template/twig/tokenparser/php.php | 2 +- 9 files changed, 129 insertions(+), 131 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/class_loader.php b/phpBB/phpbb/class_loader.php index 5fe2c16aa4..37b62fff24 100644 --- a/phpBB/phpbb/class_loader.php +++ b/phpBB/phpbb/class_loader.php @@ -47,7 +47,7 @@ class class_loader * @param \phpbb\cache\driver\driver_interface $cache An implementation of the phpBB cache interface. */ public function __construct($namespace, $path, $php_ext = 'php', \phpbb\cache\driver\driver_interface $cache = null) - { + { if ($namespace[0] !== '\\') { $namespace = '\\' . $namespace; diff --git a/phpBB/phpbb/datetime.php b/phpBB/phpbb/datetime.php index 84b13202af..dfa21976e0 100644 --- a/phpBB/phpbb/datetime.php +++ b/phpBB/phpbb/datetime.php @@ -74,8 +74,8 @@ class datetime extends \DateTime * finally check that relative dates are supported by the language pack */ if ($delta <= 3600 && $delta > -60 && - ($delta >= -5 || (($now_ts / 60) % 60) == (($timestamp / 60) % 60)) - && isset($this->user->lang['datetime']['AGO'])) + ($delta >= -5 || (($now_ts / 60) % 60) == (($timestamp / 60) % 60)) + && isset($this->user->lang['datetime']['AGO'])) { return $this->user->lang(array('datetime', 'AGO'), max(0, (int) floor($delta / 60))); } diff --git a/phpBB/phpbb/event/data.php b/phpBB/phpbb/event/data.php index bd1e0ae9ed..fbb16574ed 100644 --- a/phpBB/phpbb/event/data.php +++ b/phpBB/phpbb/event/data.php @@ -13,50 +13,50 @@ use Symfony\Component\EventDispatcher\Event; class data extends Event implements \ArrayAccess { - private $data; - - public function __construct(array $data = array()) - { - $this->set_data($data); - } - - public function set_data(array $data = array()) - { - $this->data = $data; - } - - public function get_data() - { - return $this->data; - } - - /** - * Returns data filtered to only include specified keys. - * - * This effectively discards any keys added to data by hooks. - */ - public function get_data_filtered($keys) - { - return array_intersect_key($this->data, array_flip($keys)); - } - - public function offsetExists($offset) - { - return isset($this->data[$offset]); - } - - public function offsetGet($offset) - { - return isset($this->data[$offset]) ? $this->data[$offset] : null; - } - - public function offsetSet($offset, $value) - { - $this->data[$offset] = $value; - } - - public function offsetUnset($offset) - { - unset($this->data[$offset]); - } + private $data; + + public function __construct(array $data = array()) + { + $this->set_data($data); + } + + public function set_data(array $data = array()) + { + $this->data = $data; + } + + public function get_data() + { + return $this->data; + } + + /** + * Returns data filtered to only include specified keys. + * + * This effectively discards any keys added to data by hooks. + */ + public function get_data_filtered($keys) + { + return array_intersect_key($this->data, array_flip($keys)); + } + + public function offsetExists($offset) + { + return isset($this->data[$offset]); + } + + public function offsetGet($offset) + { + return isset($this->data[$offset]) ? $this->data[$offset] : null; + } + + public function offsetSet($offset, $value) + { + $this->data[$offset] = $value; + } + + public function offsetUnset($offset) + { + unset($this->data[$offset]); + } } diff --git a/phpBB/phpbb/extension/metadata_manager.php b/phpBB/phpbb/extension/metadata_manager.php index fa46d70bc8..d0323120d8 100644 --- a/phpBB/phpbb/extension/metadata_manager.php +++ b/phpBB/phpbb/extension/metadata_manager.php @@ -139,7 +139,7 @@ class metadata_manager if (!file_exists($this->metadata_file)) { - throw new \phpbb\extension\exception('The required file does not exist: ' . $this->metadata_file); + throw new \phpbb\extension\exception('The required file does not exist: ' . $this->metadata_file); } } @@ -158,12 +158,12 @@ class metadata_manager { if (!($file_contents = file_get_contents($this->metadata_file))) { - throw new \phpbb\extension\exception('file_get_contents failed on ' . $this->metadata_file); + throw new \phpbb\extension\exception('file_get_contents failed on ' . $this->metadata_file); } if (($metadata = json_decode($file_contents, true)) === null) { - throw new \phpbb\extension\exception('json_decode failed on ' . $this->metadata_file); + throw new \phpbb\extension\exception('json_decode failed on ' . $this->metadata_file); } $this->metadata = $metadata; @@ -191,50 +191,50 @@ class metadata_manager * @return Bool True if valid, throws an exception if invalid */ public function validate($name = 'display') - { - // Basic fields - $fields = array( - 'name' => '#^[a-zA-Z0-9_\x7f-\xff]{2,}/[a-zA-Z0-9_\x7f-\xff]{2,}$#', - 'type' => '#^phpbb-extension$#', - 'licence' => '#.+#', - 'version' => '#.+#', - ); - - switch ($name) - { - case 'all': - $this->validate('display'); + { + // Basic fields + $fields = array( + 'name' => '#^[a-zA-Z0-9_\x7f-\xff]{2,}/[a-zA-Z0-9_\x7f-\xff]{2,}$#', + 'type' => '#^phpbb-extension$#', + 'licence' => '#.+#', + 'version' => '#.+#', + ); + + switch ($name) + { + case 'all': + $this->validate('display'); $this->validate_enable(); - break; + break; - case 'display': - foreach ($fields as $field => $data) + case 'display': + foreach ($fields as $field => $data) { $this->validate($field); } $this->validate_authors(); - break; - - default: - if (isset($fields[$name])) - { - if (!isset($this->metadata[$name])) - { - throw new \phpbb\extension\exception("Required meta field '$name' has not been set."); + break; + + default: + if (isset($fields[$name])) + { + if (!isset($this->metadata[$name])) + { + throw new \phpbb\extension\exception("Required meta field '$name' has not been set."); } if (!preg_match($fields[$name], $this->metadata[$name])) { - throw new \phpbb\extension\exception("Meta field '$name' is invalid."); + throw new \phpbb\extension\exception("Meta field '$name' is invalid."); } } break; } return true; - } + } /** * Validates the contents of the authors field @@ -245,14 +245,14 @@ class metadata_manager { if (empty($this->metadata['authors'])) { - throw new \phpbb\extension\exception("Required meta field 'authors' has not been set."); + throw new \phpbb\extension\exception("Required meta field 'authors' has not been set."); } foreach ($this->metadata['authors'] as $author) { if (!isset($author['name'])) { - throw new \phpbb\extension\exception("Required meta field 'author name' has not been set."); + throw new \phpbb\extension\exception("Required meta field 'author name' has not been set."); } } diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php index a3c9425183..d77a936413 100644 --- a/phpBB/phpbb/notification/manager.php +++ b/phpBB/phpbb/notification/manager.php @@ -254,8 +254,7 @@ class manager SET notification_read = 1 WHERE notification_time <= " . (int) $time . (($notification_type_name !== false) ? ' AND ' . - (is_array($notification_type_name) ? $this->db->sql_in_set('notification_type_id', $this->get_notification_type_ids($notification_type_name)) : 'notification_type_id = ' . $this->get_notification_type_id($notification_type_name)) - : '') . + (is_array($notification_type_name) ? $this->db->sql_in_set('notification_type_id', $this->get_notification_type_ids($notification_type_name)) : 'notification_type_id = ' . $this->get_notification_type_id($notification_type_name)) : '') . (($user_id !== false) ? ' AND ' . (is_array($user_id) ? $this->db->sql_in_set('user_id', $user_id) : 'user_id = ' . (int) $user_id) : '') . (($item_id !== false) ? ' AND ' . (is_array($item_id) ? $this->db->sql_in_set('item_id', $item_id) : 'item_id = ' . (int) $item_id) : ''); $this->db->sql_query($sql); @@ -277,8 +276,7 @@ class manager SET notification_read = 1 WHERE notification_time <= " . (int) $time . (($notification_type_name !== false) ? ' AND ' . - (is_array($notification_type_name) ? $this->db->sql_in_set('notification_type_id', $this->get_notification_type_ids($notification_type_name)) : 'notification_type_id = ' . $this->get_notification_type_id($notification_type_name)) - : '') . + (is_array($notification_type_name) ? $this->db->sql_in_set('notification_type_id', $this->get_notification_type_ids($notification_type_name)) : 'notification_type_id = ' . $this->get_notification_type_id($notification_type_name)) : '') . (($item_parent_id !== false) ? ' AND ' . (is_array($item_parent_id) ? $this->db->sql_in_set('item_parent_id', $item_parent_id) : 'item_parent_id = ' . (int) $item_parent_id) : '') . (($user_id !== false) ? ' AND ' . (is_array($user_id) ? $this->db->sql_in_set('user_id', $user_id) : 'user_id = ' . (int) $user_id) : ''); $this->db->sql_query($sql); diff --git a/phpBB/phpbb/search/fulltext_native.php b/phpBB/phpbb/search/fulltext_native.php index f3bb94a0c5..1b314a24d3 100644 --- a/phpBB/phpbb/search/fulltext_native.php +++ b/phpBB/phpbb/search/fulltext_native.php @@ -1180,8 +1180,8 @@ class fulltext_native extends \phpbb\search\base * we know that it will also be lower than CJK ranges */ if ((strncmp($word, UTF8_HANGUL_FIRST, 3) < 0 || strncmp($word, UTF8_HANGUL_LAST, 3) > 0) - && (strncmp($word, UTF8_CJK_FIRST, 3) < 0 || strncmp($word, UTF8_CJK_LAST, 3) > 0) - && (strncmp($word, UTF8_CJK_B_FIRST, 4) < 0 || strncmp($word, UTF8_CJK_B_LAST, 4) > 0)) + && (strncmp($word, UTF8_CJK_FIRST, 3) < 0 || strncmp($word, UTF8_CJK_LAST, 3) > 0) + && (strncmp($word, UTF8_CJK_B_FIRST, 4) < 0 || strncmp($word, UTF8_CJK_B_LAST, 4) > 0)) { $word = strtok(' '); continue; @@ -1675,8 +1675,8 @@ class fulltext_native extends \phpbb\search\base $pos += $utf_len; if (($utf_char >= UTF8_HANGUL_FIRST && $utf_char <= UTF8_HANGUL_LAST) - || ($utf_char >= UTF8_CJK_FIRST && $utf_char <= UTF8_CJK_LAST) - || ($utf_char >= UTF8_CJK_B_FIRST && $utf_char <= UTF8_CJK_B_LAST)) + || ($utf_char >= UTF8_CJK_FIRST && $utf_char <= UTF8_CJK_LAST) + || ($utf_char >= UTF8_CJK_B_FIRST && $utf_char <= UTF8_CJK_B_LAST)) { /** * All characters within these ranges are valid diff --git a/phpBB/phpbb/template/twig/extension.php b/phpBB/phpbb/template/twig/extension.php index c9d2ab5799..6847dbd9f8 100644 --- a/phpBB/phpbb/template/twig/extension.php +++ b/phpBB/phpbb/template/twig/extension.php @@ -40,11 +40,11 @@ class extension extends \Twig_Extension return 'phpbb'; } - /** - * Returns the token parser instance to add to the existing list. - * - * @return array An array of Twig_TokenParser instances - */ + /** + * Returns the token parser instance to add to the existing list. + * + * @return array An array of Twig_TokenParser instances + */ public function getTokenParsers() { return array( @@ -58,36 +58,36 @@ class extension extends \Twig_Extension ); } - /** - * Returns a list of filters to add to the existing list. - * - * @return array An array of filters - */ - public function getFilters() - { + /** + * Returns a list of filters to add to the existing list. + * + * @return array An array of filters + */ + public function getFilters() + { return array( new \Twig_SimpleFilter('subset', array($this, 'loop_subset'), array('needs_environment' => true)), new \Twig_SimpleFilter('addslashes', 'addslashes'), ); - } - - /** - * Returns a list of global functions to add to the existing list. - * - * @return array An array of global functions - */ - public function getFunctions() - { + } + + /** + * Returns a list of global functions to add to the existing list. + * + * @return array An array of global functions + */ + public function getFunctions() + { return array( new \Twig_SimpleFunction('lang', array($this, 'lang')), ); } - /** - * Returns a list of operators to add to the existing list. - * - * @return array An array of operators - */ + /** + * Returns a list of operators to add to the existing list. + * + * @return array An array of operators + */ public function getOperators() { return array( @@ -118,19 +118,19 @@ class extension extends \Twig_Extension 'mod' => array('precedence' => 60, 'class' => 'Twig_Node_Expression_Binary_Mod', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT), ), ); - } + } /** - * Grabs a subset of a loop - * - * @param Twig_Environment $env A Twig_Environment instance - * @param mixed $item A variable - * @param integer $start Start of the subset - * @param integer $end End of the subset - * @param Boolean $preserveKeys Whether to preserve key or not (when the input is an array) - * - * @return mixed The sliced variable - */ + * Grabs a subset of a loop + * + * @param Twig_Environment $env A Twig_Environment instance + * @param mixed $item A variable + * @param integer $start Start of the subset + * @param integer $end End of the subset + * @param Boolean $preserveKeys Whether to preserve key or not (when the input is an array) + * + * @return mixed The sliced variable + */ function loop_subset(\Twig_Environment $env, $item, $start, $end = null, $preserveKeys = false) { // We do almost the same thing as Twig's slice (array_slice), except when $end is positive diff --git a/phpBB/phpbb/template/twig/node/event.php b/phpBB/phpbb/template/twig/node/event.php index a8d4d06333..7a1181a866 100644 --- a/phpBB/phpbb/template/twig/node/event.php +++ b/phpBB/phpbb/template/twig/node/event.php @@ -49,10 +49,10 @@ class event extends \Twig_Node // templates on page load rather than at compile. This is // slower, but makes developing extensions easier (no need to // purge the cache when a new event template file is added) - $compiler - ->write("if (\$this->env->getLoader()->exists('@{$ext_namespace}/{$location}.html')) {\n") - ->indent() - ; + $compiler + ->write("if (\$this->env->getLoader()->exists('@{$ext_namespace}/{$location}.html')) {\n") + ->indent() + ; } if (defined('DEBUG') || $this->environment->getLoader()->exists('@' . $ext_namespace . '/' . $location . '.html')) @@ -71,7 +71,7 @@ class event extends \Twig_Node { $compiler ->outdent() - ->write("}\n\n") + ->write("}\n\n") ; } } diff --git a/phpBB/phpbb/template/twig/tokenparser/php.php b/phpBB/phpbb/template/twig/tokenparser/php.php index 13688af2f6..b427969e2d 100644 --- a/phpBB/phpbb/template/twig/tokenparser/php.php +++ b/phpBB/phpbb/template/twig/tokenparser/php.php @@ -45,5 +45,5 @@ class php extends \Twig_TokenParser public function getTag() { return 'PHP'; - } + } } -- cgit v1.2.1 From ae7ef3e09dd284b8876ad74de16321c373d251af Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Thu, 31 Oct 2013 00:48:03 +0100 Subject: [task/code-sniffer] Remove class result_mssqlnative. PHPBB3-11980 --- phpBB/phpbb/db/driver/mssqlnative.php | 169 ---------------------------------- 1 file changed, 169 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/db/driver/mssqlnative.php b/phpBB/phpbb/db/driver/mssqlnative.php index 76cbd59d93..125db9c8d4 100644 --- a/phpBB/phpbb/db/driver/mssqlnative.php +++ b/phpBB/phpbb/db/driver/mssqlnative.php @@ -13,175 +13,6 @@ namespace phpbb\db\driver; -/** - * Prior to version 1.1 the SQL Server Native PHP driver didn't support sqlsrv_num_rows, or cursor based seeking so we recall all rows into an array - * and maintain our own cursor index into that array. - */ -class result_mssqlnative -{ - public function result_mssqlnative($queryresult = false) - { - $this->m_cursor = 0; - $this->m_rows = array(); - $this->m_num_fields = sqlsrv_num_fields($queryresult); - $this->m_field_meta = sqlsrv_field_metadata($queryresult); - - while ($row = sqlsrv_fetch_array($queryresult, SQLSRV_FETCH_ASSOC)) - { - if ($row !== null) - { - foreach($row as $k => $v) - { - if (is_object($v) && method_exists($v, 'format')) - { - $row[$k] = $v->format("Y-m-d\TH:i:s\Z"); - } - } - $this->m_rows[] = $row;//read results into memory, cursors are not supported - } - } - - $this->m_row_count = sizeof($this->m_rows); - } - - private function array_to_obj($array, &$obj) - { - foreach ($array as $key => $value) - { - if (is_array($value)) - { - $obj->$key = new \stdClass(); - array_to_obj($value, $obj->$key); - } - else - { - $obj->$key = $value; - } - } - return $obj; - } - - public function fetch($mode = SQLSRV_FETCH_BOTH, $object_class = 'stdClass') - { - if ($this->m_cursor >= $this->m_row_count || $this->m_row_count == 0) - { - return false; - } - - $ret = false; - $arr_num = array(); - - if ($mode == SQLSRV_FETCH_NUMERIC || $mode == SQLSRV_FETCH_BOTH) - { - foreach($this->m_rows[$this->m_cursor] as $key => $value) - { - $arr_num[] = $value; - } - } - - switch ($mode) - { - case SQLSRV_FETCH_ASSOC: - $ret = $this->m_rows[$this->m_cursor]; - break; - case SQLSRV_FETCH_NUMERIC: - $ret = $arr_num; - break; - case 'OBJECT': - $ret = $this->array_to_obj($this->m_rows[$this->m_cursor], $o = new $object_class); - break; - case SQLSRV_FETCH_BOTH: - default: - $ret = $this->m_rows[$this->m_cursor] + $arr_num; - break; - } - $this->m_cursor++; - return $ret; - } - - public function get($pos, $fld) - { - return $this->m_rows[$pos][$fld]; - } - - public function num_rows() - { - return $this->m_row_count; - } - - public function seek($iRow) - { - $this->m_cursor = min($iRow, $this->m_row_count); - } - - public function num_fields() - { - return $this->m_num_fields; - } - - public function field_name($nr) - { - $arr_keys = array_keys($this->m_rows[0]); - return $arr_keys[$nr]; - } - - public function field_type($nr) - { - $i = 0; - $int_type = -1; - $str_type = ''; - - foreach ($this->m_field_meta as $meta) - { - if ($nr == $i) - { - $int_type = $meta['Type']; - break; - } - $i++; - } - - //http://msdn.microsoft.com/en-us/library/cc296183.aspx contains type table - switch ($int_type) - { - case SQLSRV_SQLTYPE_BIGINT: $str_type = 'bigint'; break; - case SQLSRV_SQLTYPE_BINARY: $str_type = 'binary'; break; - case SQLSRV_SQLTYPE_BIT: $str_type = 'bit'; break; - case SQLSRV_SQLTYPE_CHAR: $str_type = 'char'; break; - case SQLSRV_SQLTYPE_DATETIME: $str_type = 'datetime'; break; - case SQLSRV_SQLTYPE_DECIMAL/*($precision, $scale)*/: $str_type = 'decimal'; break; - case SQLSRV_SQLTYPE_FLOAT: $str_type = 'float'; break; - case SQLSRV_SQLTYPE_IMAGE: $str_type = 'image'; break; - case SQLSRV_SQLTYPE_INT: $str_type = 'int'; break; - case SQLSRV_SQLTYPE_MONEY: $str_type = 'money'; break; - case SQLSRV_SQLTYPE_NCHAR/*($charCount)*/: $str_type = 'nchar'; break; - case SQLSRV_SQLTYPE_NUMERIC/*($precision, $scale)*/: $str_type = 'numeric'; break; - case SQLSRV_SQLTYPE_NVARCHAR/*($charCount)*/: $str_type = 'nvarchar'; break; - case SQLSRV_SQLTYPE_NTEXT: $str_type = 'ntext'; break; - case SQLSRV_SQLTYPE_REAL: $str_type = 'real'; break; - case SQLSRV_SQLTYPE_SMALLDATETIME: $str_type = 'smalldatetime'; break; - case SQLSRV_SQLTYPE_SMALLINT: $str_type = 'smallint'; break; - case SQLSRV_SQLTYPE_SMALLMONEY: $str_type = 'smallmoney'; break; - case SQLSRV_SQLTYPE_TEXT: $str_type = 'text'; break; - case SQLSRV_SQLTYPE_TIMESTAMP: $str_type = 'timestamp'; break; - case SQLSRV_SQLTYPE_TINYINT: $str_type = 'tinyint'; break; - case SQLSRV_SQLTYPE_UNIQUEIDENTIFIER: $str_type = 'uniqueidentifier'; break; - case SQLSRV_SQLTYPE_UDT: $str_type = 'UDT'; break; - case SQLSRV_SQLTYPE_VARBINARY/*($byteCount)*/: $str_type = 'varbinary'; break; - case SQLSRV_SQLTYPE_VARCHAR/*($charCount)*/: $str_type = 'varchar'; break; - case SQLSRV_SQLTYPE_XML: $str_type = 'xml'; break; - default: $str_type = $int_type; - } - return $str_type; - } - - public function free() - { - unset($this->m_rows); - return; - } -} - /** * @package dbal */ -- cgit v1.2.1 From 414a4d587e0d19795cc621c4eb482b1c90e22251 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 2 Nov 2013 18:13:11 +0100 Subject: [ticket/11995] Fix Revert of config.remove PHPBB3-11995 --- phpBB/phpbb/db/migration/tool/config.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/db/migration/tool/config.php b/phpBB/phpbb/db/migration/tool/config.php index f2149dc59a..36a1931f4e 100644 --- a/phpBB/phpbb/db/migration/tool/config.php +++ b/phpBB/phpbb/db/migration/tool/config.php @@ -130,6 +130,10 @@ class config implements \phpbb\db\migration\tool\tool_interface case 'remove': $call = 'add'; + if (sizeof($arguments) == 1) + { + $arguments[] = ''; + } break; case 'update_if_equals': -- cgit v1.2.1 From 66c08de4cb630cdf19040ada5c685f6e451b2101 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Sat, 2 Nov 2013 13:50:09 -0700 Subject: [ticket/11746] The IN_PHPBB check is not necessary. PHPBB3-11746 --- phpBB/phpbb/notification/type/admin_activate_user.php | 8 -------- 1 file changed, 8 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/notification/type/admin_activate_user.php b/phpBB/phpbb/notification/type/admin_activate_user.php index 1231c0b75d..5f146e18ff 100644 --- a/phpBB/phpbb/notification/type/admin_activate_user.php +++ b/phpBB/phpbb/notification/type/admin_activate_user.php @@ -9,14 +9,6 @@ namespace phpbb\notification\type; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Admin activation notifications class * This class handles notifications for users requiring admin activation -- cgit v1.2.1 From 743a0560c3cced8c37b5ae840e449a60a0b51a33 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 3 Nov 2013 04:14:36 +0100 Subject: [ticket/11998] Add console command for recalculating email hash. PHPBB3-11998 --- .../command/fixup/recalculate_email_hash.php | 72 ++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 phpBB/phpbb/console/command/fixup/recalculate_email_hash.php (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/console/command/fixup/recalculate_email_hash.php b/phpBB/phpbb/console/command/fixup/recalculate_email_hash.php new file mode 100644 index 0000000000..b788fe5631 --- /dev/null +++ b/phpBB/phpbb/console/command/fixup/recalculate_email_hash.php @@ -0,0 +1,72 @@ +db = $db; + + parent::__construct(); + } + + protected function configure() + { + $this + ->setName('fixup:recalculate-email-hash') + ->setDescription('Recalculates the user_email_hash column of the users table.') + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $sql = 'SELECT user_id, user_email, user_email_hash + FROM ' . USERS_TABLE . ' + WHERE user_type <> ' . USER_IGNORE . " + AND user_email <> ''"; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $user_email_hash = phpbb_email_hash($row['user_email']); + if ($user_email_hash !== $row['user_email_hash']) + { + $sql_ary = array( + 'user_email_hash' => $user_email_hash, + ); + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE user_id = ' . (int) $row['user_id']; + $this->db->sql_query($sql); + + if ($output->getVerbosity() >= OutputInterface::VERBOSITY_DEBUG) + { + $output->writeln(sprintf( + 'user_id %d, email %s => %s', + $row['user_id'], + $row['user_email'], + $user_email_hash + )); + } + } + } + $this->db->sql_freeresult($result); + + $output->writeln('Successfully recalculated all email hashes.'); + } +} -- cgit v1.2.1 From b49d3a1851330d64009c8050132e50b093172559 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Mon, 4 Nov 2013 12:21:12 -0600 Subject: [ticket/11943] Do not quote the value when it is exactly true, false, or null Quoting these can change the meaning of the value (e.g. 'false' == true) PHPBB3-11943 --- phpBB/phpbb/template/twig/lexer.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/template/twig/lexer.php b/phpBB/phpbb/template/twig/lexer.php index be53b3eb5b..8c52fa65b2 100644 --- a/phpBB/phpbb/template/twig/lexer.php +++ b/phpBB/phpbb/template/twig/lexer.php @@ -129,6 +129,14 @@ class lexer extends \Twig_Lexer // Replace template variables with start/end to parse variables (' ~ TEST ~ '.html) $matches[2] = preg_replace('#{([a-zA-Z0-9_\.$]+)}#', "'~ \$1 ~'", $matches[2]); + // If the second item is exactly one of a few key words, + // do not quote it as it changes the meaning + // http://tracker.phpbb.com/browse/PHPBB3-11943 + if (in_array($matches[2], array('false', 'true', 'null'))) + { + return ""; + } + // Surround the matches in single quotes ('' ~ TEST ~ '.html') return ""; }; -- cgit v1.2.1 From 73ea5daf97bf5447b9bb2ff912cce4a9ea21c58e Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 5 Nov 2013 19:42:34 +0100 Subject: [ticket/11998] Add phpBB abstraction for application and command. PHPBB3-11998 --- phpBB/phpbb/console/application.php | 23 ++++++++++++++++++++++ phpBB/phpbb/console/command/command.php | 14 +++++++++++++ .../command/fixup/recalculate_email_hash.php | 3 +-- 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 phpBB/phpbb/console/application.php create mode 100644 phpBB/phpbb/console/command/command.php (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/console/application.php b/phpBB/phpbb/console/application.php new file mode 100644 index 0000000000..fdcd9d42f6 --- /dev/null +++ b/phpBB/phpbb/console/application.php @@ -0,0 +1,23 @@ +findTaggedServiceIds($tag) as $id => $void) + { + $this->add($container->get($id)); + } + } +} diff --git a/phpBB/phpbb/console/command/command.php b/phpBB/phpbb/console/command/command.php new file mode 100644 index 0000000000..6abbdd203c --- /dev/null +++ b/phpBB/phpbb/console/command/command.php @@ -0,0 +1,14 @@ + Date: Tue, 5 Nov 2013 21:40:42 +0100 Subject: [ticket/11998] Turn develop/extensions.php into console commands. PHPBB3-11998 --- phpBB/phpbb/console/command/extension/command.php | 22 +++++++++ phpBB/phpbb/console/command/extension/disable.php | 47 ++++++++++++++++++ phpBB/phpbb/console/command/extension/enable.php | 47 ++++++++++++++++++ phpBB/phpbb/console/command/extension/purge.php | 47 ++++++++++++++++++ phpBB/phpbb/console/command/extension/show.php | 58 +++++++++++++++++++++++ 5 files changed, 221 insertions(+) create mode 100644 phpBB/phpbb/console/command/extension/command.php create mode 100644 phpBB/phpbb/console/command/extension/disable.php create mode 100644 phpBB/phpbb/console/command/extension/enable.php create mode 100644 phpBB/phpbb/console/command/extension/purge.php create mode 100644 phpBB/phpbb/console/command/extension/show.php (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/console/command/extension/command.php b/phpBB/phpbb/console/command/extension/command.php new file mode 100644 index 0000000000..edde7ce2e2 --- /dev/null +++ b/phpBB/phpbb/console/command/extension/command.php @@ -0,0 +1,22 @@ +manager = $manager; + + parent::__construct(); + } +} diff --git a/phpBB/phpbb/console/command/extension/disable.php b/phpBB/phpbb/console/command/extension/disable.php new file mode 100644 index 0000000000..e4de70ca34 --- /dev/null +++ b/phpBB/phpbb/console/command/extension/disable.php @@ -0,0 +1,47 @@ +setName('extension:disable') + ->setDescription('Disables the specified extension.') + ->addArgument( + 'extension-name', + InputArgument::REQUIRED, + 'Name of the extension' + ) + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $name = $input->getArgument('extension-name'); + $this->manager->disable($name); + $this->manager->load_extensions(); + + if ($this->manager->enabled($name)) + { + $output->writeln("Could not disable extension $name"); + return 1; + } + else + { + $output->writeln("Successfully disabled extension $name"); + return 0; + } + } +} diff --git a/phpBB/phpbb/console/command/extension/enable.php b/phpBB/phpbb/console/command/extension/enable.php new file mode 100644 index 0000000000..ee7dae76aa --- /dev/null +++ b/phpBB/phpbb/console/command/extension/enable.php @@ -0,0 +1,47 @@ +setName('extension:enable') + ->setDescription('Enables the specified extension.') + ->addArgument( + 'extension-name', + InputArgument::REQUIRED, + 'Name of the extension' + ) + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $name = $input->getArgument('extension-name'); + $this->manager->enable($name); + $this->manager->load_extensions(); + + if ($this->manager->enabled($name)) + { + $output->writeln("Successfully enabled extension $name"); + return 0; + } + else + { + $output->writeln("Could not enable extension $name"); + return 1; + } + } +} diff --git a/phpBB/phpbb/console/command/extension/purge.php b/phpBB/phpbb/console/command/extension/purge.php new file mode 100644 index 0000000000..c2e1d2928c --- /dev/null +++ b/phpBB/phpbb/console/command/extension/purge.php @@ -0,0 +1,47 @@ +setName('extension:purge') + ->setDescription('Purges the specified extension.') + ->addArgument( + 'extension-name', + InputArgument::REQUIRED, + 'Name of the extension' + ) + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $name = $input->getArgument('extension-name'); + $this->manager->purge($name); + $this->manager->load_extensions(); + + if ($this->manager->enabled($name)) + { + $output->writeln("Could not purge extension $name"); + return 1; + } + else + { + $output->writeln("Successfully purge extension $name"); + return 0; + } + } +} diff --git a/phpBB/phpbb/console/command/extension/show.php b/phpBB/phpbb/console/command/extension/show.php new file mode 100644 index 0000000000..0f48ac2379 --- /dev/null +++ b/phpBB/phpbb/console/command/extension/show.php @@ -0,0 +1,58 @@ +setName('extension:show') + ->setDescription('Lists all extensions in the database and on the filesystem.') + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $this->manager->load_extensions(); + $all = array_keys($this->manager->all_available()); + + if (empty($all)) + { + $output->writeln('No extensions were found.'); + return 3; + } + + $enabled = array_keys($this->manager->all_enabled()); + $this->print_extension_list($output, 'Enabled', $enabled); + + $output->writeln(''); + + $disabled = array_keys($this->manager->all_disabled()); + $this->print_extension_list($output, 'Disabled', $disabled); + + $output->writeln(''); + + $purged = array_diff($all, $enabled, $disabled); + $this->print_extension_list($output, 'Available', $purged); + } + + protected function print_extension_list(OutputInterface $output, $type, array $extensions) + { + $output->writeln("$type:"); + + foreach ($extensions as $extension) + { + $output->writeln(" - $extension"); + } + } +} -- cgit v1.2.1 From 6f33954757a05044c8700a70051ae25e3a5cc627 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 8 Nov 2013 17:37:52 +0100 Subject: [ticket/11922] Drop all keys before trying to delete columns to avoid issues On MSSQL columns that have an index can not be dropped. PHPBB3-11922 --- phpBB/phpbb/db/migration/data/v310/softdelete_p2.php | 6 +++++- phpBB/phpbb/db/migration/data/v310/style_update_p2.php | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/db/migration/data/v310/softdelete_p2.php b/phpBB/phpbb/db/migration/data/v310/softdelete_p2.php index 0c32e474f4..38b190c766 100644 --- a/phpBB/phpbb/db/migration/data/v310/softdelete_p2.php +++ b/phpBB/phpbb/db/migration/data/v310/softdelete_p2.php @@ -34,7 +34,10 @@ class softdelete_p2 extends \phpbb\db\migration\migration ), 'drop_keys' => array( $this->table_prefix . 'posts' => array('post_approved'), - $this->table_prefix . 'topics' => array('forum_appr_last'), + $this->table_prefix . 'topics' => array( + 'forum_appr_last', + 'topic_approved', + ), ), ); } @@ -63,6 +66,7 @@ class softdelete_p2 extends \phpbb\db\migration\migration ), $this->table_prefix . 'topics' => array( 'forum_appr_last' => array('forum_id', 'topic_approved', 'topic_last_post_id'), + 'topic_approved' => array('topic_approved'), ), ), ); diff --git a/phpBB/phpbb/db/migration/data/v310/style_update_p2.php b/phpBB/phpbb/db/migration/data/v310/style_update_p2.php index c5b45d9dc9..40d6a4dbbd 100644 --- a/phpBB/phpbb/db/migration/data/v310/style_update_p2.php +++ b/phpBB/phpbb/db/migration/data/v310/style_update_p2.php @@ -24,6 +24,14 @@ class style_update_p2 extends \phpbb\db\migration\migration public function update_schema() { return array( + 'drop_keys' => array( + $this->table_prefix . 'styles' => array( + 'imageset_id', + 'template_id', + 'theme_id', + ), + ), + 'drop_columns' => array( $this->table_prefix . 'styles' => array( 'imageset_id', @@ -53,6 +61,14 @@ class style_update_p2 extends \phpbb\db\migration\migration ), ), + 'add_index' => array( + $this->table_prefix . 'styles' => array( + 'imageset_id' => array('imageset_id'), + 'template_id' => array('template_id'), + 'theme_id' => array('theme_id'), + ), + ), + 'add_tables' => array( $this->table_prefix . 'styles_imageset' => array( 'COLUMNS' => array( -- cgit v1.2.1 From 1173adfe87f4622cbf3bfb53393166616c04b25f Mon Sep 17 00:00:00 2001 From: Dhruv Date: Fri, 8 Nov 2013 23:34:49 +0530 Subject: [ticket/12007] Default last_result to 0 instead of false PostgreSQL does not map null/false to 0 and thus this variable causes an error. PHPBB3-12007 --- phpBB/phpbb/db/migrator.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/db/migrator.php b/phpBB/phpbb/db/migrator.php index 3b966b7fe3..8186493800 100644 --- a/phpBB/phpbb/db/migrator.php +++ b/phpBB/phpbb/db/migrator.php @@ -375,7 +375,7 @@ class migrator foreach ($steps as $step_identifier => $step) { - $last_result = false; + $last_result = 0; if ($state) { // Continue until we reach the step that matches the last step called @@ -436,7 +436,7 @@ class migrator * @param bool $reverse False to install, True to attempt uninstallation by reversing the call * @return null */ - protected function run_step($step, $last_result = false, $reverse = false) + protected function run_step($step, $last_result = 0, $reverse = false) { $callable_and_parameters = $this->get_callable_from_step($step, $last_result, $reverse); @@ -459,7 +459,7 @@ class migrator * @param bool $reverse False to install, True to attempt uninstallation by reversing the call * @return array Array with parameters for call_user_func_array(), 0 is the callable, 1 is parameters */ - protected function get_callable_from_step(array $step, $last_result = false, $reverse = false) + protected function get_callable_from_step(array $step, $last_result = 0, $reverse = false) { $type = $step[0]; $parameters = $step[1]; -- cgit v1.2.1 From 65fbf87ce717b50b5d14babbd264a64640f5c7b6 Mon Sep 17 00:00:00 2001 From: Lukasz Date: Thu, 7 Nov 2013 19:53:54 +0100 Subject: [ticket/12005] Remove PM popup PHPBB3-12005 --- phpBB/phpbb/user.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php index ce0dc3c1df..b2ab187a70 100644 --- a/phpBB/phpbb/user.php +++ b/phpBB/phpbb/user.php @@ -36,7 +36,7 @@ class user extends \phpbb\session var $img_array = array(); // Able to add new options (up to id 31) - var $keyoptions = array('viewimg' => 0, 'viewflash' => 1, 'viewsmilies' => 2, 'viewsigs' => 3, 'viewavatars' => 4, 'viewcensors' => 5, 'attachsig' => 6, 'bbcode' => 8, 'smilies' => 9, 'popuppm' => 10, 'sig_bbcode' => 15, 'sig_smilies' => 16, 'sig_links' => 17); + var $keyoptions = array('viewimg' => 0, 'viewflash' => 1, 'viewsmilies' => 2, 'viewsigs' => 3, 'viewavatars' => 4, 'viewcensors' => 5, 'attachsig' => 6, 'bbcode' => 8, 'smilies' => 9, 'sig_bbcode' => 15, 'sig_smilies' => 16, 'sig_links' => 17); /** * Constructor to set the lang path -- cgit v1.2.1 From a353673e7c3e5a5a4720bea008e1df60c1401ae2 Mon Sep 17 00:00:00 2001 From: Lukasz Date: Thu, 7 Nov 2013 22:06:48 +0100 Subject: [ticket/12005] Remove PM popup module from DB PHPBB3-12005 --- .../db/migration/data/v310/ucp_popuppm_module.php | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v310/ucp_popuppm_module.php (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/db/migration/data/v310/ucp_popuppm_module.php b/phpBB/phpbb/db/migration/data/v310/ucp_popuppm_module.php new file mode 100644 index 0000000000..f8ada6c6f5 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/ucp_popuppm_module.php @@ -0,0 +1,42 @@ +db->sql_query($sql); + $module_id = $this->db->sql_fetchfield('module_id'); + $this->db->sql_freeresult($result); + + return $module_id == false; + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\dev'); + } + + public function update_data() + { + return array( + array('module.remove', array( + 'ucp', + 'UCP_PM', + 'UCP_PM_POPUP_TITLE', + )), + ); + } +} -- cgit v1.2.1 From da332aa0a5cbeabbcce5551ee955c701fc2a1d73 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Fri, 8 Nov 2013 19:55:16 -0600 Subject: [ticket/11943] Require stricter DEFINE statements for templates PHPBB3-11943 --- phpBB/phpbb/template/twig/lexer.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/template/twig/lexer.php b/phpBB/phpbb/template/twig/lexer.php index 8c52fa65b2..efd6a0bd84 100644 --- a/phpBB/phpbb/template/twig/lexer.php +++ b/phpBB/phpbb/template/twig/lexer.php @@ -69,7 +69,7 @@ class lexer extends \Twig_Lexer // Fix tokens that may have inline variables (e.g. "; - } - // Surround the matches in single quotes ('' ~ TEST ~ '.html') return ""; }; -- cgit v1.2.1 From 6370970f13d58f617379da64efb1f88a522f3f03 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Fri, 8 Nov 2013 22:30:58 -0600 Subject: [ticket/11943] Split fix_inline_variable_tokens into 3 steps DEFINE shouldn't add/remove surrounding quotes, but must have the inline variable tokens fixed PHPBB3-11943 --- phpBB/phpbb/template/twig/lexer.php | 60 ++++++++++++++++++++++++++++++------- 1 file changed, 50 insertions(+), 10 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/template/twig/lexer.php b/phpBB/phpbb/template/twig/lexer.php index efd6a0bd84..f4efc58540 100644 --- a/phpBB/phpbb/template/twig/lexer.php +++ b/phpBB/phpbb/template/twig/lexer.php @@ -68,8 +68,20 @@ class lexer extends \Twig_Lexer ); // Fix tokens that may have inline variables (e.g. #', '', $code); + } + /** * Fix tokens that may have inline variables * - * E.g. "; + return ""; }; return preg_replace_callback('##', $callback, $code); } + /** + * Add surrounding quotes + * + * Last step to fix tokens that may have inline variables + * E.g. #', '', $code); + } + /** * Fix begin tokens (convert our BEGIN to Twig for) * -- cgit v1.2.1 From 31e60f0c8d5e248bbf318cec410b27cff6dbee74 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 9 Nov 2013 17:06:38 +0100 Subject: [ticket/11949] Do not prepend leading backslash to cache class name The container seems to prepend the leading \ itself, so we get an InvalidArgumentException with message '"'\\phpbb\\cache\\driver\\file'" is not a valid class name for the "cache.driver" service.' PHPBB3-11949 --- phpBB/phpbb/di/extension/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/di/extension/config.php b/phpBB/phpbb/di/extension/config.php index 5fcb2d6f10..2603e7b358 100644 --- a/phpBB/phpbb/di/extension/config.php +++ b/phpBB/phpbb/di/extension/config.php @@ -70,7 +70,7 @@ class config extends Extension { if (preg_match('#^[a-z]+$#', $acm_type)) { - return '\\phpbb\cache\driver\\'.$acm_type; + return 'phpbb\\cache\\driver\\' . $acm_type; } return $acm_type; -- cgit v1.2.1 From 2e5117a71eb64c734e5738235c44ef92818ca33b Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Sat, 9 Nov 2013 11:14:55 -0600 Subject: [ticket/11943] Throw an exception if DEFINE is setup improperly PHPBB3-11943 --- phpBB/phpbb/template/twig/tokenparser/defineparser.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/template/twig/tokenparser/defineparser.php b/phpBB/phpbb/template/twig/tokenparser/defineparser.php index 21add0c17c..8484f2e81a 100644 --- a/phpBB/phpbb/template/twig/tokenparser/defineparser.php +++ b/phpBB/phpbb/template/twig/tokenparser/defineparser.php @@ -30,6 +30,13 @@ class defineparser extends \Twig_TokenParser $stream->next(); $value = $this->parser->getExpressionParser()->parseExpression(); + if ($value instanceof \Twig_Node_Expression_Name) + { + // This would happen if someone improperly formed their DEFINE syntax + // e.g. + throw new \Twig_Error_Syntax('Invalid DEFINE', $token->getLine(), $this->parser->getFilename()); + } + $stream->expect(\Twig_Token::BLOCK_END_TYPE); } else { $capture = true; -- cgit v1.2.1 From 47f2caff6b3f05f6703e359bf4712bd69d23c04c Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 10 Nov 2013 22:19:06 +0100 Subject: [ticket/11525] Fix doc blocks PHPBB3-11525 --- phpBB/phpbb/avatar/manager.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/avatar/manager.php b/phpBB/phpbb/avatar/manager.php index f2bb1a5dbe..90cd83898f 100644 --- a/phpBB/phpbb/avatar/manager.php +++ b/phpBB/phpbb/avatar/manager.php @@ -180,8 +180,8 @@ class manager /** * Strip out user_, group_, or other prefixes from array keys * - * @param array $row User data or group data - * @param string $prefix Prefix of data keys + * @param array $row User data or group data + * @param string $prefix Prefix of data keys (e.g. user), should not include the trailing underscore * * @return array User data or group data with keys that have been * stripped from the preceding "user_" or "group_" @@ -205,8 +205,11 @@ class manager /** * Strip prepending user_ or group_ prefix from key * - * @param string Array key - * @return void + * @param string $key Array key + * @param string $null Parameter is ignored by the function, just required by the array_walk + * @param string $prefix Prefix that should be stripped off from the keys (e.g. user) + * Should not include the trailing underscore + * @return null */ static protected function strip_prefix(&$key, $null, $prefix) { -- cgit v1.2.1 From aa84f7de04b0efdf871d75694aee60e5ecf37f56 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 10 Nov 2013 23:07:07 +0100 Subject: [ticket/11525] Prefix id parameter with 'g' again when its a group avatar PHPBB3-11525 --- phpBB/phpbb/avatar/manager.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/avatar/manager.php b/phpBB/phpbb/avatar/manager.php index 90cd83898f..9f6a5fb089 100644 --- a/phpBB/phpbb/avatar/manager.php +++ b/phpBB/phpbb/avatar/manager.php @@ -183,8 +183,9 @@ class manager * @param array $row User data or group data * @param string $prefix Prefix of data keys (e.g. user), should not include the trailing underscore * - * @return array User data or group data with keys that have been - * stripped from the preceding "user_" or "group_" + * @return array User or group data with keys that have been + * stripped from the preceding "user_" or "group_" + * Also the group id is prefixed with g, when the prefix group is removed. */ static public function clean_row($row, $prefix = '') { @@ -198,8 +199,14 @@ class manager $values = array_values($row); array_walk($keys, array('\phpbb\avatar\manager', 'strip_prefix'), $prefix); + $row = array_combine($keys, $values); - return array_combine($keys, $values); + if ($prefix == 'group') + { + $row['id'] = 'g' . $row['id']; + } + + return $row; } /** -- cgit v1.2.1 From b1719db47df4f3089f90bbfac2ca0bec24dcf027 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 11 Nov 2013 20:15:28 +0100 Subject: [ticket/11912] Add extension_guesser for guessing mimetype by extension The content_guesser now only guesses the mimetype with the function mime_content_type() while the guessing by extension is done using the extension_guesser. PHPBB3-11912 --- phpBB/phpbb/mimetype/content_guesser.php | 481 +-------------------------- phpBB/phpbb/mimetype/extension_guesser.php | 517 +++++++++++++++++++++++++++++ 2 files changed, 518 insertions(+), 480 deletions(-) create mode 100644 phpBB/phpbb/mimetype/extension_guesser.php (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/mimetype/content_guesser.php b/phpBB/phpbb/mimetype/content_guesser.php index f5be9cd44b..21631ae6d3 100644 --- a/phpBB/phpbb/mimetype/content_guesser.php +++ b/phpBB/phpbb/mimetype/content_guesser.php @@ -23,460 +23,6 @@ if (!defined('IN_PHPBB')) class content_guesser implements guesser_interface { - /** - * @var file extension map - */ - protected $extension_map = array( - '3dm' => 'x-world/x-3dmf', - '3dmf' => 'x-world/x-3dmf', - 'a' => 'application/octet-stream', - 'aab' => 'application/x-authorware-bin', - 'aam' => 'application/x-authorware-map', - 'aas' => 'application/x-authorware-seg', - 'abc' => 'text/vnd.abc', - 'acgi' => 'text/html', - 'afl' => 'video/animaflex', - 'ai' => 'application/postscript', - 'aif' => 'audio/aiff', - 'aifc' => 'audio/aiff', - 'aiff' => 'audio/aiff', - 'aim' => 'application/x-aim', - 'aip' => 'text/x-audiosoft-intra', - 'ani' => 'application/x-navi-animation', - 'aos' => 'application/x-nokia-9000-communicator-add-on-software', - 'aps' => 'application/mime', - 'arc' => 'application/octet-stream', - 'arj' => 'application/arj', - 'art' => 'image/x-jg', - 'asf' => 'video/x-ms-asf', - 'asm' => 'text/x-asm', - 'asp' => 'text/asp', - 'asx' => 'video/x-ms-asf', - 'au' => 'audio/x-au', - 'avi' => 'video/avi', - 'avs' => 'video/avs-video', - 'bcpio' => 'application/x-bcpio', - 'bin' => 'application/x-binary', - 'bm' => 'image/bmp', - 'bmp' => 'image/bmp', - 'boo' => 'application/book', - 'book' => 'application/book', - 'boz' => 'application/x-bzip2', - 'bsh' => 'application/x-bsh', - 'bz' => 'application/x-bzip', - 'bz2' => 'application/x-bzip2', - 'c' => 'text/x-c', - 'c++' => 'text/x-c', - 'cat' => 'application/vnd.ms-pki.seccat', - 'cc' => 'text/plain', - 'ccad' => 'application/clariscad', - 'cco' => 'application/x-cocoa', - 'cdf' => 'application/cdf', - 'cer' => 'application/x-x509-ca-cert', - 'cha' => 'application/x-chat', - 'chat' => 'application/x-chat', - 'class' => 'application/java', - 'com' => 'application/octet-stream', - 'conf' => 'text/plain', - 'cpio' => 'application/x-cpio', - 'cpp' => 'text/x-c', - 'cpt' => 'application/x-cpt', - 'crl' => 'application/pkix-crl', - 'crt' => 'application/x-x509-ca-cert', - 'csh' => 'application/x-csh', - 'css' => 'text/css', - 'cxx' => 'text/plain', - 'dcr' => 'application/x-director', - 'deepv' => 'application/x-deepv', - 'def' => 'text/plain', - 'der' => 'application/x-x509-ca-cert', - 'dif' => 'video/x-dv', - 'dir' => 'application/x-director', - 'dl' => 'video/dl', - 'doc' => 'application/msword', - 'dot' => 'application/msword', - 'dp' => 'application/commonground', - 'drw' => 'application/drafting', - 'dump' => 'application/octet-stream', - 'dv' => 'video/x-dv', - 'dvi' => 'application/x-dvi', - 'dwf' => 'model/vnd.dwf', - 'dwg' => 'image/x-dwg', - 'dxf' => 'image/x-dwg', - 'dxr' => 'application/x-director', - 'el' => 'text/x-script.elisp', - 'elc' => 'application/x-elc', - 'env' => 'application/x-envoy', - 'eps' => 'application/postscript', - 'es' => 'application/x-esrehber', - 'etx' => 'text/x-setext', - 'evy' => 'application/x-envoy', - 'exe' => 'application/octet-stream', - 'f' => 'text/x-fortran', - 'f77' => 'text/x-fortran', - 'f90' => 'text/x-fortran', - 'fdf' => 'application/vnd.fdf', - 'fif' => 'image/fif', - 'fli' => 'video/x-fli', - 'flo' => 'image/florian', - 'flx' => 'text/vnd.fmi.flexstor', - 'fmf' => 'video/x-atomic3d-feature', - 'for' => 'text/x-fortran', - 'fpx' => 'image/vnd.fpx', - 'frl' => 'application/freeloader', - 'funk' => 'audio/make', - 'g' => 'text/plain', - 'g3' => 'image/g3fax', - 'gif' => 'image/gif', - 'gl' => 'video/x-gl', - 'gsd' => 'audio/x-gsm', - 'gsm' => 'audio/x-gsm', - 'gsp' => 'application/x-gsp', - 'gss' => 'application/x-gss', - 'gtar' => 'application/x-gtar', - 'gz' => 'application/x-gzip', - 'gzip' => 'application/x-gzip', - 'h' => 'text/x-h', - 'hdf' => 'application/x-hdf', - 'help' => 'application/x-helpfile', - 'hgl' => 'application/vnd.hp-hpgl', - 'hh' => 'text/x-h', - 'hlb' => 'text/x-script', - 'hlp' => 'application/hlp', - 'hpg' => 'application/vnd.hp-hpgl', - 'hpgl' => 'application/vnd.hp-hpgl', - 'hqx' => 'application/x-binhex40', - 'hta' => 'application/hta', - 'htc' => 'text/x-component', - 'htm' => 'text/html', - 'html' => 'text/html', - 'htmls' => 'text/html', - 'htt' => 'text/webviewhtml', - 'htx' => 'text/html', - 'ice' => 'x-conference/x-cooltalk', - 'ico' => 'image/x-icon', - 'idc' => 'text/plain', - 'ief' => 'image/ief', - 'iefs' => 'image/ief', - 'iges' => 'application/iges', - 'igs' => 'application/iges', - 'ima' => 'application/x-ima', - 'imap' => 'application/x-httpd-imap', - 'inf' => 'application/inf', - 'ins' => 'application/x-internett-signup', - 'ip' => 'application/x-ip2', - 'isu' => 'video/x-isvideo', - 'it' => 'audio/it', - 'iv' => 'application/x-inventor', - 'ivr' => 'i-world/i-vrml', - 'ivy' => 'application/x-livescreen', - 'jam' => 'audio/x-jam', - 'jav' => 'text/plain', - 'jav' => 'text/x-java-source', - 'java' => 'text/x-java-source', - 'jcm' => 'application/x-java-commerce', - 'jfif' => 'image/jpeg', - 'jfif-tbnl' => 'image/jpeg', - 'jpe' => 'image/jpeg', - 'jpeg' => 'image/jpeg', - 'jpg' => 'image/jpeg', - 'jps' => 'image/x-jps', - 'js' => 'application/x-javascript', - 'jut' => 'image/jutvision', - 'kar' => 'audio/midi', - 'ksh' => 'text/x-script.ksh', - 'la' => 'audio/x-nspaudio', - 'lam' => 'audio/x-liveaudio', - 'latex' => 'application/x-latex', - 'lha' => 'application/x-lha', - 'lhx' => 'application/octet-stream', - 'list' => 'text/plain', - 'lma' => 'audio/x-nspaudio', - 'log' => 'text/plain', - 'lsp' => 'text/x-script.lisp', - 'lst' => 'text/plain', - 'lsx' => 'text/x-la-asf', - 'ltx' => 'application/x-latex', - 'lzh' => 'application/x-lzh', - 'lzx' => 'application/x-lzx', - 'm' => 'text/x-m', - 'm1v' => 'video/mpeg', - 'm2a' => 'audio/mpeg', - 'm2v' => 'video/mpeg', - 'm3u' => 'audio/x-mpequrl', - 'man' => 'application/x-troff-man', - 'map' => 'application/x-navimap', - 'mar' => 'text/plain', - 'mbd' => 'application/mbedlet', - 'mc$' => 'application/x-magic-cap-package-1.0', - 'mcd' => 'application/x-mathcad', - 'mcf' => 'text/mcf', - 'mcp' => 'application/netmc', - 'me' => 'application/x-troff-me', - 'mht' => 'message/rfc822', - 'mhtml' => 'message/rfc822', - 'mid' => 'audio/x-midi', - 'midi' => 'audio/x-midi', - 'mif' => 'application/x-mif', - 'mime' => 'www/mime', - 'mjf' => 'audio/x-vnd.audioexplosion.mjuicemediafile', - 'mjpg' => 'video/x-motion-jpeg', - 'mm' => 'application/x-meme', - 'mme' => 'application/base64', - 'mod' => 'audio/x-mod', - 'moov' => 'video/quicktime', - 'mov' => 'video/quicktime', - 'movie' => 'video/x-sgi-movie', - 'mp2' => 'audio/x-mpeg', - 'mp3' => 'audio/x-mpeg-3', - 'mpa' => 'audio/mpeg', - 'mpc' => 'application/x-project', - 'mpe' => 'video/mpeg', - 'mpeg' => 'video/mpeg', - 'mpg' => 'video/mpeg', - 'mpga' => 'audio/mpeg', - 'mpp' => 'application/vnd.ms-project', - 'mpt' => 'application/x-project', - 'mpv' => 'application/x-project', - 'mpx' => 'application/x-project', - 'mrc' => 'application/marc', - 'ms' => 'application/x-troff-ms', - 'mv' => 'video/x-sgi-movie', - 'my' => 'audio/make', - 'mzz' => 'application/x-vnd.audioexplosion.mzz', - 'nap' => 'image/naplps', - 'naplps' => 'image/naplps', - 'nc' => 'application/x-netcdf', - 'ncm' => 'application/vnd.nokia.configuration-message', - 'nif' => 'image/x-niff', - 'niff' => 'image/x-niff', - 'nix' => 'application/x-mix-transfer', - 'nsc' => 'application/x-conference', - 'nvd' => 'application/x-navidoc', - 'o' => 'application/octet-stream', - 'oda' => 'application/oda', - 'omc' => 'application/x-omc', - 'omcd' => 'application/x-omcdatamaker', - 'omcr' => 'application/x-omcregerator', - 'p' => 'text/x-pascal', - 'p10' => 'application/x-pkcs10', - 'p12' => 'application/x-pkcs12', - 'p7a' => 'application/x-pkcs7-signature', - 'p7c' => 'application/x-pkcs7-mime', - 'p7m' => 'application/x-pkcs7-mime', - 'p7r' => 'application/x-pkcs7-certreqresp', - 'p7s' => 'application/pkcs7-signature', - 'part' => 'application/pro_eng', - 'pas' => 'text/pascal', - 'pbm' => 'image/x-portable-bitmap', - 'pcl' => 'application/x-pcl', - 'pct' => 'image/x-pict', - 'pcx' => 'image/x-pcx', - 'pdb' => 'chemical/x-pdb', - 'pdf' => 'application/pdf', - 'pfunk' => 'audio/make.my.funk', - 'pgm' => 'image/x-portable-greymap', - 'pic' => 'image/pict', - 'pict' => 'image/pict', - 'pkg' => 'application/x-newton-compatible-pkg', - 'pko' => 'application/vnd.ms-pki.pko', - 'pl' => 'text/x-script.perl', - 'plx' => 'application/x-pixclscript', - 'pm' => 'text/x-script.perl-module', - 'pm4' => 'application/x-pagemaker', - 'pm5' => 'application/x-pagemaker', - 'png' => 'image/png', - 'pnm' => 'image/x-portable-anymap', - 'pot' => 'application/mspowerpoint', - 'pov' => 'model/x-pov', - 'ppa' => 'application/vnd.ms-powerpoint', - 'ppm' => 'image/x-portable-pixmap', - 'pps' => 'application/mspowerpoint', - 'ppt' => 'application/mspowerpoint', - 'ppz' => 'application/mspowerpoint', - 'pre' => 'application/x-freelance', - 'prt' => 'application/pro_eng', - 'ps' => 'application/postscript', - 'psd' => 'application/octet-stream', - 'pvu' => 'paleovu/x-pv', - 'pwz' => 'application/vnd.ms-powerpoint', - 'py' => 'text/x-script.phyton', - 'pyc' => 'applicaiton/x-bytecode.python', - 'qcp' => 'audio/vnd.qcelp', - 'qd3' => 'x-world/x-3dmf', - 'qd3d' => 'x-world/x-3dmf', - 'qif' => 'image/x-quicktime', - 'qt' => 'video/quicktime', - 'qtc' => 'video/x-qtc', - 'qti' => 'image/x-quicktime', - 'qtif' => 'image/x-quicktime', - 'ra' => 'audio/x-realaudio', - 'ram' => 'audio/x-pn-realaudio', - 'ras' => 'image/x-cmu-raster', - 'rast' => 'image/cmu-raster', - 'rexx' => 'text/x-script.rexx', - 'rf' => 'image/vnd.rn-realflash', - 'rgb' => 'image/x-rgb', - 'rm' => 'audio/x-pn-realaudio', - 'rmi' => 'audio/mid', - 'rmm' => 'audio/x-pn-realaudio', - 'rmp' => 'audio/x-pn-realaudio', - 'rng' => 'application/vnd.nokia.ringing-tone', - 'rnx' => 'application/vnd.rn-realplayer', - 'roff' => 'application/x-troff', - 'rp' => 'image/vnd.rn-realpix', - 'rpm' => 'audio/x-pn-realaudio-plugin', - 'rt' => 'text/richtext', - 'rtf' => 'text/richtext', - 'rtx' => 'text/richtext', - 'rv' => 'video/vnd.rn-realvideo', - 's' => 'text/x-asm', - 's3m' => 'audio/s3m', - 'saveme' => 'application/octet-stream', - 'sbk' => 'application/x-tbook', - 'scm' => 'video/x-scm', - 'sdml' => 'text/plain', - 'sdp' => 'application/x-sdp', - 'sdr' => 'application/sounder', - 'sea' => 'application/x-sea', - 'set' => 'application/set', - 'sgm' => 'text/x-sgml', - 'sgml' => 'text/x-sgml', - 'sh' => 'text/x-script.sh', - 'shar' => 'application/x-shar', - 'shtml' => 'text/x-server-parsed-html', - 'sid' => 'audio/x-psid', - 'sit' => 'application/x-stuffit', - 'skd' => 'application/x-koan', - 'skm' => 'application/x-koan', - 'skp' => 'application/x-koan', - 'skt' => 'application/x-koan', - 'sl' => 'application/x-seelogo', - 'smi' => 'application/smil', - 'smil' => 'application/smil', - 'snd' => 'audio/x-adpcm', - 'sol' => 'application/solids', - 'spc' => 'text/x-speech', - 'spl' => 'application/futuresplash', - 'spr' => 'application/x-sprite', - 'sprite' => 'application/x-sprite', - 'src' => 'application/x-wais-source', - 'ssi' => 'text/x-server-parsed-html', - 'ssm' => 'application/streamingmedia', - 'sst' => 'application/vnd.ms-pki.certstore', - 'step' => 'application/step', - 'stl' => 'application/vnd.ms-pki.stl', - 'stp' => 'application/step', - 'sv4cpio' => 'application/x-sv4cpio', - 'sv4crc' => 'application/x-sv4crc', - 'svf' => 'image/x-dwg', - 'svr' => 'application/x-world', - 'swf' => 'application/x-shockwave-flash', - 't' => 'application/x-troff', - 'talk' => 'text/x-speech', - 'tar' => 'application/x-tar', - 'tbk' => 'application/x-tbook', - 'tcl' => 'text/x-script.tcl', - 'tcsh' => 'text/x-script.tcsh', - 'tex' => 'application/x-tex', - 'texi' => 'application/x-texinfo', - 'texinfo' => 'application/x-texinfo', - 'text' => 'text/plain', - 'tgz' => 'application/x-compressed', - 'tif' => 'image/tiff', - 'tiff' => 'image/tiff', - 'tr' => 'application/x-troff', - 'tsi' => 'audio/tsp-audio', - 'tsp' => 'audio/tsplayer', - 'tsv' => 'text/tab-separated-values', - 'turbot' => 'image/florian', - 'txt' => 'text/plain', - 'uil' => 'text/x-uil', - 'uni' => 'text/uri-list', - 'unis' => 'text/uri-list', - 'unv' => 'application/i-deas', - 'uri' => 'text/uri-list', - 'uris' => 'text/uri-list', - 'ustar' => 'multipart/x-ustar', - 'uu' => 'text/x-uuencode', - 'uue' => 'text/x-uuencode', - 'vcd' => 'application/x-cdlink', - 'vcs' => 'text/x-vcalendar', - 'vda' => 'application/vda', - 'vdo' => 'video/vdo', - 'vew' => 'application/groupwise', - 'viv' => 'video/vivo', - 'vivo' => 'video/vivo', - 'vmd' => 'application/vocaltec-media-desc', - 'vmf' => 'application/vocaltec-media-file', - 'voc' => 'audio/voc', - 'vos' => 'video/vosaic', - 'vox' => 'audio/voxware', - 'vqe' => 'audio/x-twinvq-plugin', - 'vqf' => 'audio/x-twinvq', - 'vql' => 'audio/x-twinvq-plugin', - 'vrml' => 'application/x-vrml', - 'vrt' => 'x-world/x-vrt', - 'vsd' => 'application/x-visio', - 'vst' => 'application/x-visio', - 'vsw' => 'application/x-visio', - 'w60' => 'application/wordperfect6.0', - 'w61' => 'application/wordperfect6.1', - 'w6w' => 'application/msword', - 'wav' => 'audio/wav', - 'wb1' => 'application/x-qpro', - 'wbmp' => 'image/vnd.wap.wbmp', - 'web' => 'application/vnd.xara', - 'wiz' => 'application/msword', - 'wk1' => 'application/x-123', - 'wmf' => 'windows/metafile', - 'wml' => 'text/vnd.wap.wml', - 'wmlc' => 'application/vnd.wap.wmlc', - 'wmls' => 'text/vnd.wap.wmlscript', - 'wmlsc' => 'application/vnd.wap.wmlscriptc', - 'word' => 'application/msword', - 'wp' => 'application/wordperfect', - 'wp5' => 'application/wordperfect', - 'wp6' => 'application/wordperfect', - 'wpd' => 'application/wordperfect', - 'wq1' => 'application/x-lotus', - 'wri' => 'application/mswrite', - 'wrl' => 'model/vrml', - 'wrz' => 'model/vrml', - 'wsc' => 'text/scriplet', - 'wsrc' => 'application/x-wais-source', - 'wtk' => 'application/x-wintalk', - 'xbm' => 'image/xbm', - 'xdr' => 'video/x-amt-demorun', - 'xgz' => 'xgl/drawing', - 'xif' => 'image/vnd.xiff', - 'xl' => 'application/excel', - 'xla' => 'application/excel', - 'xlb' => 'application/excel', - 'xlc' => 'application/excel', - 'xld' => 'application/excel', - 'xlk' => 'application/excel', - 'xll' => 'application/excel', - 'xlm' => 'application/excel', - 'xls' => 'application/excel', - 'xlt' => 'application/excel', - 'xlv' => 'application/excel', - 'xlw' => 'application/excel', - 'xm' => 'audio/xm', - 'xml' => 'text/xml', - 'xmz' => 'xgl/movie', - 'xpix' => 'application/x-vnd.ls-xpix', - 'xpm' => 'image/xpm', - 'x-png' => 'image/png', - 'xsr' => 'video/x-amt-showrun', - 'xwd' => 'image/x-xwindowdump', - 'xyz' => 'chemical/x-pdb', - 'z' => 'application/x-compressed', - 'zip' => 'application/x-zip-compressed', - 'zoo' => 'application/octet-stream', - 'zsh' => 'text/x-script.zsh', - ); - /** * @inheritdoc */ @@ -495,32 +41,7 @@ class content_guesser implements guesser_interface { $mimetype = mime_content_type($file); } - else - { - $file_name = (empty($file_name)) ? $file : $file_name; - $mimetype = $this->map_extension_to_type($file_name); - } - return $mimetype; - } - - /** - * Map extension of supplied file_name to mime type - * - * @param string $file_name Path to file or filename - * - * @return string|null Mimetype if known or null if not - */ - protected function map_extension_to_type($file_name) - { - $extension = pathinfo($file_name, PATHINFO_EXTENSION); - if (isset($this->extension_map[$extension])) - { - return $this->extension_map[$extension]; - } - else - { - return null; - } + return $mimetype; } } diff --git a/phpBB/phpbb/mimetype/extension_guesser.php b/phpBB/phpbb/mimetype/extension_guesser.php new file mode 100644 index 0000000000..8cca974efc --- /dev/null +++ b/phpBB/phpbb/mimetype/extension_guesser.php @@ -0,0 +1,517 @@ + 'x-world/x-3dmf', + '3dmf' => 'x-world/x-3dmf', + 'a' => 'application/octet-stream', + 'aab' => 'application/x-authorware-bin', + 'aam' => 'application/x-authorware-map', + 'aas' => 'application/x-authorware-seg', + 'abc' => 'text/vnd.abc', + 'acgi' => 'text/html', + 'afl' => 'video/animaflex', + 'ai' => 'application/postscript', + 'aif' => 'audio/aiff', + 'aifc' => 'audio/aiff', + 'aiff' => 'audio/aiff', + 'aim' => 'application/x-aim', + 'aip' => 'text/x-audiosoft-intra', + 'ani' => 'application/x-navi-animation', + 'aos' => 'application/x-nokia-9000-communicator-add-on-software', + 'aps' => 'application/mime', + 'arc' => 'application/octet-stream', + 'arj' => 'application/arj', + 'art' => 'image/x-jg', + 'asf' => 'video/x-ms-asf', + 'asm' => 'text/x-asm', + 'asp' => 'text/asp', + 'asx' => 'video/x-ms-asf', + 'au' => 'audio/x-au', + 'avi' => 'video/avi', + 'avs' => 'video/avs-video', + 'bcpio' => 'application/x-bcpio', + 'bin' => 'application/x-binary', + 'bm' => 'image/bmp', + 'bmp' => 'image/bmp', + 'boo' => 'application/book', + 'book' => 'application/book', + 'boz' => 'application/x-bzip2', + 'bsh' => 'application/x-bsh', + 'bz' => 'application/x-bzip', + 'bz2' => 'application/x-bzip2', + 'c' => 'text/x-c', + 'c++' => 'text/x-c', + 'cat' => 'application/vnd.ms-pki.seccat', + 'cc' => 'text/plain', + 'ccad' => 'application/clariscad', + 'cco' => 'application/x-cocoa', + 'cdf' => 'application/cdf', + 'cer' => 'application/x-x509-ca-cert', + 'cha' => 'application/x-chat', + 'chat' => 'application/x-chat', + 'class' => 'application/java', + 'com' => 'application/octet-stream', + 'conf' => 'text/plain', + 'cpio' => 'application/x-cpio', + 'cpp' => 'text/x-c', + 'cpt' => 'application/x-cpt', + 'crl' => 'application/pkix-crl', + 'crt' => 'application/x-x509-ca-cert', + 'csh' => 'application/x-csh', + 'css' => 'text/css', + 'cxx' => 'text/plain', + 'dcr' => 'application/x-director', + 'deepv' => 'application/x-deepv', + 'def' => 'text/plain', + 'der' => 'application/x-x509-ca-cert', + 'dif' => 'video/x-dv', + 'dir' => 'application/x-director', + 'dl' => 'video/dl', + 'doc' => 'application/msword', + 'dot' => 'application/msword', + 'dp' => 'application/commonground', + 'drw' => 'application/drafting', + 'dump' => 'application/octet-stream', + 'dv' => 'video/x-dv', + 'dvi' => 'application/x-dvi', + 'dwf' => 'model/vnd.dwf', + 'dwg' => 'image/x-dwg', + 'dxf' => 'image/x-dwg', + 'dxr' => 'application/x-director', + 'el' => 'text/x-script.elisp', + 'elc' => 'application/x-elc', + 'env' => 'application/x-envoy', + 'eps' => 'application/postscript', + 'es' => 'application/x-esrehber', + 'etx' => 'text/x-setext', + 'evy' => 'application/x-envoy', + 'exe' => 'application/octet-stream', + 'f' => 'text/x-fortran', + 'f77' => 'text/x-fortran', + 'f90' => 'text/x-fortran', + 'fdf' => 'application/vnd.fdf', + 'fif' => 'image/fif', + 'fli' => 'video/x-fli', + 'flo' => 'image/florian', + 'flx' => 'text/vnd.fmi.flexstor', + 'fmf' => 'video/x-atomic3d-feature', + 'for' => 'text/x-fortran', + 'fpx' => 'image/vnd.fpx', + 'frl' => 'application/freeloader', + 'funk' => 'audio/make', + 'g' => 'text/plain', + 'g3' => 'image/g3fax', + 'gif' => 'image/gif', + 'gl' => 'video/x-gl', + 'gsd' => 'audio/x-gsm', + 'gsm' => 'audio/x-gsm', + 'gsp' => 'application/x-gsp', + 'gss' => 'application/x-gss', + 'gtar' => 'application/x-gtar', + 'gz' => 'application/x-gzip', + 'gzip' => 'application/x-gzip', + 'h' => 'text/x-h', + 'hdf' => 'application/x-hdf', + 'help' => 'application/x-helpfile', + 'hgl' => 'application/vnd.hp-hpgl', + 'hh' => 'text/x-h', + 'hlb' => 'text/x-script', + 'hlp' => 'application/hlp', + 'hpg' => 'application/vnd.hp-hpgl', + 'hpgl' => 'application/vnd.hp-hpgl', + 'hqx' => 'application/x-binhex40', + 'hta' => 'application/hta', + 'htc' => 'text/x-component', + 'htm' => 'text/html', + 'html' => 'text/html', + 'htmls' => 'text/html', + 'htt' => 'text/webviewhtml', + 'htx' => 'text/html', + 'ice' => 'x-conference/x-cooltalk', + 'ico' => 'image/x-icon', + 'idc' => 'text/plain', + 'ief' => 'image/ief', + 'iefs' => 'image/ief', + 'iges' => 'application/iges', + 'igs' => 'application/iges', + 'ima' => 'application/x-ima', + 'imap' => 'application/x-httpd-imap', + 'inf' => 'application/inf', + 'ins' => 'application/x-internett-signup', + 'ip' => 'application/x-ip2', + 'isu' => 'video/x-isvideo', + 'it' => 'audio/it', + 'iv' => 'application/x-inventor', + 'ivr' => 'i-world/i-vrml', + 'ivy' => 'application/x-livescreen', + 'jam' => 'audio/x-jam', + 'jav' => 'text/plain', + 'jav' => 'text/x-java-source', + 'java' => 'text/x-java-source', + 'jcm' => 'application/x-java-commerce', + 'jfif' => 'image/jpeg', + 'jfif-tbnl' => 'image/jpeg', + 'jpe' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'jpg' => 'image/jpeg', + 'jps' => 'image/x-jps', + 'js' => 'application/x-javascript', + 'jut' => 'image/jutvision', + 'kar' => 'audio/midi', + 'ksh' => 'text/x-script.ksh', + 'la' => 'audio/x-nspaudio', + 'lam' => 'audio/x-liveaudio', + 'latex' => 'application/x-latex', + 'lha' => 'application/x-lha', + 'lhx' => 'application/octet-stream', + 'list' => 'text/plain', + 'lma' => 'audio/x-nspaudio', + 'log' => 'text/plain', + 'lsp' => 'text/x-script.lisp', + 'lst' => 'text/plain', + 'lsx' => 'text/x-la-asf', + 'ltx' => 'application/x-latex', + 'lzh' => 'application/x-lzh', + 'lzx' => 'application/x-lzx', + 'm' => 'text/x-m', + 'm1v' => 'video/mpeg', + 'm2a' => 'audio/mpeg', + 'm2v' => 'video/mpeg', + 'm3u' => 'audio/x-mpequrl', + 'man' => 'application/x-troff-man', + 'map' => 'application/x-navimap', + 'mar' => 'text/plain', + 'mbd' => 'application/mbedlet', + 'mc$' => 'application/x-magic-cap-package-1.0', + 'mcd' => 'application/x-mathcad', + 'mcf' => 'text/mcf', + 'mcp' => 'application/netmc', + 'me' => 'application/x-troff-me', + 'mht' => 'message/rfc822', + 'mhtml' => 'message/rfc822', + 'mid' => 'audio/x-midi', + 'midi' => 'audio/x-midi', + 'mif' => 'application/x-mif', + 'mime' => 'www/mime', + 'mjf' => 'audio/x-vnd.audioexplosion.mjuicemediafile', + 'mjpg' => 'video/x-motion-jpeg', + 'mm' => 'application/x-meme', + 'mme' => 'application/base64', + 'mod' => 'audio/x-mod', + 'moov' => 'video/quicktime', + 'mov' => 'video/quicktime', + 'movie' => 'video/x-sgi-movie', + 'mp2' => 'audio/x-mpeg', + 'mp3' => 'audio/x-mpeg-3', + 'mpa' => 'audio/mpeg', + 'mpc' => 'application/x-project', + 'mpe' => 'video/mpeg', + 'mpeg' => 'video/mpeg', + 'mpg' => 'video/mpeg', + 'mpga' => 'audio/mpeg', + 'mpp' => 'application/vnd.ms-project', + 'mpt' => 'application/x-project', + 'mpv' => 'application/x-project', + 'mpx' => 'application/x-project', + 'mrc' => 'application/marc', + 'ms' => 'application/x-troff-ms', + 'mv' => 'video/x-sgi-movie', + 'my' => 'audio/make', + 'mzz' => 'application/x-vnd.audioexplosion.mzz', + 'nap' => 'image/naplps', + 'naplps' => 'image/naplps', + 'nc' => 'application/x-netcdf', + 'ncm' => 'application/vnd.nokia.configuration-message', + 'nif' => 'image/x-niff', + 'niff' => 'image/x-niff', + 'nix' => 'application/x-mix-transfer', + 'nsc' => 'application/x-conference', + 'nvd' => 'application/x-navidoc', + 'o' => 'application/octet-stream', + 'oda' => 'application/oda', + 'omc' => 'application/x-omc', + 'omcd' => 'application/x-omcdatamaker', + 'omcr' => 'application/x-omcregerator', + 'p' => 'text/x-pascal', + 'p10' => 'application/x-pkcs10', + 'p12' => 'application/x-pkcs12', + 'p7a' => 'application/x-pkcs7-signature', + 'p7c' => 'application/x-pkcs7-mime', + 'p7m' => 'application/x-pkcs7-mime', + 'p7r' => 'application/x-pkcs7-certreqresp', + 'p7s' => 'application/pkcs7-signature', + 'part' => 'application/pro_eng', + 'pas' => 'text/pascal', + 'pbm' => 'image/x-portable-bitmap', + 'pcl' => 'application/x-pcl', + 'pct' => 'image/x-pict', + 'pcx' => 'image/x-pcx', + 'pdb' => 'chemical/x-pdb', + 'pdf' => 'application/pdf', + 'pfunk' => 'audio/make.my.funk', + 'pgm' => 'image/x-portable-greymap', + 'pic' => 'image/pict', + 'pict' => 'image/pict', + 'pkg' => 'application/x-newton-compatible-pkg', + 'pko' => 'application/vnd.ms-pki.pko', + 'pl' => 'text/x-script.perl', + 'plx' => 'application/x-pixclscript', + 'pm' => 'text/x-script.perl-module', + 'pm4' => 'application/x-pagemaker', + 'pm5' => 'application/x-pagemaker', + 'png' => 'image/png', + 'pnm' => 'image/x-portable-anymap', + 'pot' => 'application/mspowerpoint', + 'pov' => 'model/x-pov', + 'ppa' => 'application/vnd.ms-powerpoint', + 'ppm' => 'image/x-portable-pixmap', + 'pps' => 'application/mspowerpoint', + 'ppt' => 'application/mspowerpoint', + 'ppz' => 'application/mspowerpoint', + 'pre' => 'application/x-freelance', + 'prt' => 'application/pro_eng', + 'ps' => 'application/postscript', + 'psd' => 'application/octet-stream', + 'pvu' => 'paleovu/x-pv', + 'pwz' => 'application/vnd.ms-powerpoint', + 'py' => 'text/x-script.phyton', + 'pyc' => 'applicaiton/x-bytecode.python', + 'qcp' => 'audio/vnd.qcelp', + 'qd3' => 'x-world/x-3dmf', + 'qd3d' => 'x-world/x-3dmf', + 'qif' => 'image/x-quicktime', + 'qt' => 'video/quicktime', + 'qtc' => 'video/x-qtc', + 'qti' => 'image/x-quicktime', + 'qtif' => 'image/x-quicktime', + 'ra' => 'audio/x-realaudio', + 'ram' => 'audio/x-pn-realaudio', + 'ras' => 'image/x-cmu-raster', + 'rast' => 'image/cmu-raster', + 'rexx' => 'text/x-script.rexx', + 'rf' => 'image/vnd.rn-realflash', + 'rgb' => 'image/x-rgb', + 'rm' => 'audio/x-pn-realaudio', + 'rmi' => 'audio/mid', + 'rmm' => 'audio/x-pn-realaudio', + 'rmp' => 'audio/x-pn-realaudio', + 'rng' => 'application/vnd.nokia.ringing-tone', + 'rnx' => 'application/vnd.rn-realplayer', + 'roff' => 'application/x-troff', + 'rp' => 'image/vnd.rn-realpix', + 'rpm' => 'audio/x-pn-realaudio-plugin', + 'rt' => 'text/richtext', + 'rtf' => 'text/richtext', + 'rtx' => 'text/richtext', + 'rv' => 'video/vnd.rn-realvideo', + 's' => 'text/x-asm', + 's3m' => 'audio/s3m', + 'saveme' => 'application/octet-stream', + 'sbk' => 'application/x-tbook', + 'scm' => 'video/x-scm', + 'sdml' => 'text/plain', + 'sdp' => 'application/x-sdp', + 'sdr' => 'application/sounder', + 'sea' => 'application/x-sea', + 'set' => 'application/set', + 'sgm' => 'text/x-sgml', + 'sgml' => 'text/x-sgml', + 'sh' => 'text/x-script.sh', + 'shar' => 'application/x-shar', + 'shtml' => 'text/x-server-parsed-html', + 'sid' => 'audio/x-psid', + 'sit' => 'application/x-stuffit', + 'skd' => 'application/x-koan', + 'skm' => 'application/x-koan', + 'skp' => 'application/x-koan', + 'skt' => 'application/x-koan', + 'sl' => 'application/x-seelogo', + 'smi' => 'application/smil', + 'smil' => 'application/smil', + 'snd' => 'audio/x-adpcm', + 'sol' => 'application/solids', + 'spc' => 'text/x-speech', + 'spl' => 'application/futuresplash', + 'spr' => 'application/x-sprite', + 'sprite' => 'application/x-sprite', + 'src' => 'application/x-wais-source', + 'ssi' => 'text/x-server-parsed-html', + 'ssm' => 'application/streamingmedia', + 'sst' => 'application/vnd.ms-pki.certstore', + 'step' => 'application/step', + 'stl' => 'application/vnd.ms-pki.stl', + 'stp' => 'application/step', + 'sv4cpio' => 'application/x-sv4cpio', + 'sv4crc' => 'application/x-sv4crc', + 'svf' => 'image/x-dwg', + 'svr' => 'application/x-world', + 'swf' => 'application/x-shockwave-flash', + 't' => 'application/x-troff', + 'talk' => 'text/x-speech', + 'tar' => 'application/x-tar', + 'tbk' => 'application/x-tbook', + 'tcl' => 'text/x-script.tcl', + 'tcsh' => 'text/x-script.tcsh', + 'tex' => 'application/x-tex', + 'texi' => 'application/x-texinfo', + 'texinfo' => 'application/x-texinfo', + 'text' => 'text/plain', + 'tgz' => 'application/x-compressed', + 'tif' => 'image/tiff', + 'tiff' => 'image/tiff', + 'tr' => 'application/x-troff', + 'tsi' => 'audio/tsp-audio', + 'tsp' => 'audio/tsplayer', + 'tsv' => 'text/tab-separated-values', + 'turbot' => 'image/florian', + 'txt' => 'text/plain', + 'uil' => 'text/x-uil', + 'uni' => 'text/uri-list', + 'unis' => 'text/uri-list', + 'unv' => 'application/i-deas', + 'uri' => 'text/uri-list', + 'uris' => 'text/uri-list', + 'ustar' => 'multipart/x-ustar', + 'uu' => 'text/x-uuencode', + 'uue' => 'text/x-uuencode', + 'vcd' => 'application/x-cdlink', + 'vcs' => 'text/x-vcalendar', + 'vda' => 'application/vda', + 'vdo' => 'video/vdo', + 'vew' => 'application/groupwise', + 'viv' => 'video/vivo', + 'vivo' => 'video/vivo', + 'vmd' => 'application/vocaltec-media-desc', + 'vmf' => 'application/vocaltec-media-file', + 'voc' => 'audio/voc', + 'vos' => 'video/vosaic', + 'vox' => 'audio/voxware', + 'vqe' => 'audio/x-twinvq-plugin', + 'vqf' => 'audio/x-twinvq', + 'vql' => 'audio/x-twinvq-plugin', + 'vrml' => 'application/x-vrml', + 'vrt' => 'x-world/x-vrt', + 'vsd' => 'application/x-visio', + 'vst' => 'application/x-visio', + 'vsw' => 'application/x-visio', + 'w60' => 'application/wordperfect6.0', + 'w61' => 'application/wordperfect6.1', + 'w6w' => 'application/msword', + 'wav' => 'audio/wav', + 'wb1' => 'application/x-qpro', + 'wbmp' => 'image/vnd.wap.wbmp', + 'web' => 'application/vnd.xara', + 'wiz' => 'application/msword', + 'wk1' => 'application/x-123', + 'wmf' => 'windows/metafile', + 'wml' => 'text/vnd.wap.wml', + 'wmlc' => 'application/vnd.wap.wmlc', + 'wmls' => 'text/vnd.wap.wmlscript', + 'wmlsc' => 'application/vnd.wap.wmlscriptc', + 'word' => 'application/msword', + 'wp' => 'application/wordperfect', + 'wp5' => 'application/wordperfect', + 'wp6' => 'application/wordperfect', + 'wpd' => 'application/wordperfect', + 'wq1' => 'application/x-lotus', + 'wri' => 'application/mswrite', + 'wrl' => 'model/vrml', + 'wrz' => 'model/vrml', + 'wsc' => 'text/scriplet', + 'wsrc' => 'application/x-wais-source', + 'wtk' => 'application/x-wintalk', + 'xbm' => 'image/xbm', + 'xdr' => 'video/x-amt-demorun', + 'xgz' => 'xgl/drawing', + 'xif' => 'image/vnd.xiff', + 'xl' => 'application/excel', + 'xla' => 'application/excel', + 'xlb' => 'application/excel', + 'xlc' => 'application/excel', + 'xld' => 'application/excel', + 'xlk' => 'application/excel', + 'xll' => 'application/excel', + 'xlm' => 'application/excel', + 'xls' => 'application/excel', + 'xlt' => 'application/excel', + 'xlv' => 'application/excel', + 'xlw' => 'application/excel', + 'xm' => 'audio/xm', + 'xml' => 'text/xml', + 'xmz' => 'xgl/movie', + 'xpix' => 'application/x-vnd.ls-xpix', + 'xpm' => 'image/xpm', + 'x-png' => 'image/png', + 'xsr' => 'video/x-amt-showrun', + 'xwd' => 'image/x-xwindowdump', + 'xyz' => 'chemical/x-pdb', + 'z' => 'application/x-compressed', + 'zip' => 'application/x-zip-compressed', + 'zoo' => 'application/octet-stream', + 'zsh' => 'text/x-script.zsh', + ); + + /** + * @inheritdoc + */ + public function is_supported() + { + return true; + } + + /** + * @inheritdoc + */ + public function guess($file, $file_name = '') + { + $file_name = (empty($file_name)) ? $file : $file_name; + return $this->map_extension_to_type($file_name); + } + + /** + * Map extension of supplied file_name to mime type + * + * @param string $file_name Path to file or filename + * + * @return string|null Mimetype if known or null if not + */ + protected function map_extension_to_type($file_name) + { + $extension = pathinfo($file_name, PATHINFO_EXTENSION); + + if (isset($this->extension_map[$extension])) + { + return $this->extension_map[$extension]; + } + else + { + return null; + } + } +} -- cgit v1.2.1 From bef6a5a6401314da7e5688907f4ebfc06ef83f2b Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 11 Nov 2013 21:18:23 +0100 Subject: [ticket/11912] Introduce guesser priority to mimetype guessers The mimetype guesser priority can now be set through the service definition. Mimetypes will be guessed from the guesser with the highest priority to the one with the lowest priority. Standard priority types have been added to the service definition file. Any integer value can be used though. Standard mimetype guessers that do not have the methods get_priority and set_priority implemented, like the standard MimeTypeGuessers of symfony, will have the default priority with the value of 0. Lower priority guessers have values lower than 0 while high priority ones can be added with values higher than 0. PHPBB3-11912 --- phpBB/phpbb/mimetype/content_guesser.php | 2 +- phpBB/phpbb/mimetype/extension_guesser.php | 2 +- phpBB/phpbb/mimetype/guesser.php | 35 ++++++++++++++++++++++- phpBB/phpbb/mimetype/guesser_base.php | 46 ++++++++++++++++++++++++++++++ phpBB/phpbb/mimetype/guesser_interface.php | 16 +++++++++++ 5 files changed, 98 insertions(+), 3 deletions(-) create mode 100644 phpBB/phpbb/mimetype/guesser_base.php (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/mimetype/content_guesser.php b/phpBB/phpbb/mimetype/content_guesser.php index 21631ae6d3..ffaed9136a 100644 --- a/phpBB/phpbb/mimetype/content_guesser.php +++ b/phpBB/phpbb/mimetype/content_guesser.php @@ -21,7 +21,7 @@ if (!defined('IN_PHPBB')) * @package mimetype */ -class content_guesser implements guesser_interface +class content_guesser extends guesser_base { /** * @inheritdoc diff --git a/phpBB/phpbb/mimetype/extension_guesser.php b/phpBB/phpbb/mimetype/extension_guesser.php index 8cca974efc..f9459c84ec 100644 --- a/phpBB/phpbb/mimetype/extension_guesser.php +++ b/phpBB/phpbb/mimetype/extension_guesser.php @@ -21,7 +21,7 @@ if (!defined('IN_PHPBB')) * @package mimetype */ -class extension_guesser implements guesser_interface +class extension_guesser extends guesser_base { /** * @var file extension map diff --git a/phpBB/phpbb/mimetype/guesser.php b/phpBB/phpbb/mimetype/guesser.php index 231b75f604..753fd65b0d 100644 --- a/phpBB/phpbb/mimetype/guesser.php +++ b/phpBB/phpbb/mimetype/guesser.php @@ -23,6 +23,11 @@ if (!defined('IN_PHPBB')) class guesser { + /** + * @const Default priority for mimetype guessers + */ + const PRIORITY_DEFAULT = 0; + /** * @var mimetype guessers */ @@ -39,7 +44,7 @@ class guesser } /** - * Register MimeTypeGuessers + * Register MimeTypeGuessers and sort them by priority * * @param array $mimetype_guessers Mimetype guesser service collection * @@ -68,6 +73,34 @@ class guesser { throw new \LogicException('No mimetype guesser supplied.'); } + + // Sort guessers by priority + usort($this->guessers, array($this, 'sort_priority')); + } + + /** + * Sort the priority of supplied guessers + * This is a compare function for usort. A guesser with higher priority + * should be used first and vice versa. usort() orders the array values + * from low to high depending on what the comparison function returns + * to it. Return value should be smaller than 0 if value a is smaller + * than value b. This has been reversed in the comparision function in + * order to sort the guessers from high to low. + * Method has been set to public in order to allow proper testing. + * + * @param object $guesser_a Mimetype guesser a + * @param object $guesser_b Mimetype guesser b + * + * @return int If both guessers have the same priority 0, bigger + * than 0 if first guesser has lower priority, and lower + * than 0 if first guesser has higher priority + */ + public function sort_priority($guesser_a, $guesser_b) + { + $priority_a = (int) (method_exists($guesser_a, 'get_priority')) ? $guesser_a->get_priority() : self::PRIORITY_DEFAULT; + $priority_b = (int) (method_exists($guesser_b, 'get_priority')) ? $guesser_b->get_priority() : self::PRIORITY_DEFAULT; + + return $priority_b - $priority_a; } /** diff --git a/phpBB/phpbb/mimetype/guesser_base.php b/phpBB/phpbb/mimetype/guesser_base.php new file mode 100644 index 0000000000..b35badea54 --- /dev/null +++ b/phpBB/phpbb/mimetype/guesser_base.php @@ -0,0 +1,46 @@ +priority; + } + + /** + * @inheritdoc + */ + public function set_priority($priority) + { + $this->priority = $priority; + } +} diff --git a/phpBB/phpbb/mimetype/guesser_interface.php b/phpBB/phpbb/mimetype/guesser_interface.php index a9b238d7aa..defff90654 100644 --- a/phpBB/phpbb/mimetype/guesser_interface.php +++ b/phpBB/phpbb/mimetype/guesser_interface.php @@ -38,4 +38,20 @@ interface guesser_interface * @return string Guess for mimetype of file */ public function guess($file, $file_name = ''); + + /** + * Get the guesser priority + * + * @return int Guesser priority + */ + public function get_priority(); + + /** + * Set the guesser priority + * + * @param int Guesser priority + * + * @return void + */ + public function set_priority($priority); } -- cgit v1.2.1 From 81caa35955b696e1ffdcafe4ccdd72a83700b773 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 11 Nov 2013 21:24:44 +0100 Subject: [ticket/11912] Remove obsolete $file_info from plupload PHPBB3-11912 --- phpBB/phpbb/plupload/plupload.php | 2 -- 1 file changed, 2 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/plupload/plupload.php b/phpBB/phpbb/plupload/plupload.php index dedc3cbcd4..f9f2fdd812 100644 --- a/phpBB/phpbb/plupload/plupload.php +++ b/phpBB/phpbb/plupload/plupload.php @@ -128,8 +128,6 @@ class plupload { rename("{$file_path}.part", $file_path); - $file_info = new \Symfony\Component\HttpFoundation\File\File($file_path); - // Need to modify some of the $_FILES values to reflect the new file return array( 'tmp_name' => $file_path, -- cgit v1.2.1 From 9d4893b04760e3e1bff023e3615ad19beb699068 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 11 Nov 2013 21:29:11 +0100 Subject: [ticket/11912] Remove IN_PHPBB checks from mimetype guesser files PHPBB3-11912 --- phpBB/phpbb/mimetype/content_guesser.php | 8 -------- phpBB/phpbb/mimetype/extension_guesser.php | 8 -------- phpBB/phpbb/mimetype/guesser.php | 8 -------- phpBB/phpbb/mimetype/guesser_base.php | 8 -------- phpBB/phpbb/mimetype/guesser_interface.php | 8 -------- 5 files changed, 40 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/mimetype/content_guesser.php b/phpBB/phpbb/mimetype/content_guesser.php index ffaed9136a..ea15393b94 100644 --- a/phpBB/phpbb/mimetype/content_guesser.php +++ b/phpBB/phpbb/mimetype/content_guesser.php @@ -9,14 +9,6 @@ namespace phpbb\mimetype; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * @package mimetype */ diff --git a/phpBB/phpbb/mimetype/extension_guesser.php b/phpBB/phpbb/mimetype/extension_guesser.php index f9459c84ec..f6f4ae0138 100644 --- a/phpBB/phpbb/mimetype/extension_guesser.php +++ b/phpBB/phpbb/mimetype/extension_guesser.php @@ -9,14 +9,6 @@ namespace phpbb\mimetype; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * @package mimetype */ diff --git a/phpBB/phpbb/mimetype/guesser.php b/phpBB/phpbb/mimetype/guesser.php index 753fd65b0d..3499b3b0f7 100644 --- a/phpBB/phpbb/mimetype/guesser.php +++ b/phpBB/phpbb/mimetype/guesser.php @@ -9,14 +9,6 @@ namespace phpbb\mimetype; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * @package mimetype */ diff --git a/phpBB/phpbb/mimetype/guesser_base.php b/phpBB/phpbb/mimetype/guesser_base.php index b35badea54..082b098028 100644 --- a/phpBB/phpbb/mimetype/guesser_base.php +++ b/phpBB/phpbb/mimetype/guesser_base.php @@ -9,14 +9,6 @@ namespace phpbb\mimetype; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * @package mimetype */ diff --git a/phpBB/phpbb/mimetype/guesser_interface.php b/phpBB/phpbb/mimetype/guesser_interface.php index defff90654..103689765e 100644 --- a/phpBB/phpbb/mimetype/guesser_interface.php +++ b/phpBB/phpbb/mimetype/guesser_interface.php @@ -9,14 +9,6 @@ namespace phpbb\mimetype; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * @package mimetype */ -- cgit v1.2.1 From e380eed78e6f3076c5d7cb3df3a016165781e73d Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 12 Nov 2013 00:35:52 +0100 Subject: [ticket/11912] Remove obsolete variable $mimetype from content_guesser PHPBB3-11912 --- phpBB/phpbb/mimetype/content_guesser.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/mimetype/content_guesser.php b/phpBB/phpbb/mimetype/content_guesser.php index ea15393b94..623438ee0b 100644 --- a/phpBB/phpbb/mimetype/content_guesser.php +++ b/phpBB/phpbb/mimetype/content_guesser.php @@ -28,12 +28,11 @@ class content_guesser extends guesser_base */ public function guess($file, $file_name = '') { - $mimetype = null; if (function_exists('mime_content_type')) { - $mimetype = mime_content_type($file); + return mime_content_type($file); } - return $mimetype; + return null; // optional } } -- cgit v1.2.1 From d3f9a51709d538824f4ec7afe8a2d6934dabb13c Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 13 Nov 2013 17:34:06 +0100 Subject: [ticket/12016] Use a service provider for event listeners This allows them to use dependency injection PHPBB3-12016 --- phpBB/phpbb/event/extension_subscriber_loader.php | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/event/extension_subscriber_loader.php b/phpBB/phpbb/event/extension_subscriber_loader.php index df8e093f4a..6408f93e2a 100644 --- a/phpBB/phpbb/event/extension_subscriber_loader.php +++ b/phpBB/phpbb/event/extension_subscriber_loader.php @@ -14,26 +14,22 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface; class extension_subscriber_loader { private $dispatcher; - private $extension_manager; + private $listener_collection; - public function __construct(EventDispatcherInterface $dispatcher, \phpbb\extension\manager $extension_manager) + public function __construct(EventDispatcherInterface $dispatcher, \phpbb\di\service_collection $listener_collection) { $this->dispatcher = $dispatcher; - $this->extension_manager = $extension_manager; + $this->listener_collection = $listener_collection; } public function load() { - $finder = $this->extension_manager->get_finder(); - $subscriber_classes = $finder - ->extension_directory('/event') - ->core_path('event/') - ->get_classes(); - - foreach ($subscriber_classes as $class) + if (!empty($this->listener_collection)) { - $subscriber = new $class(); - $this->dispatcher->addSubscriber($subscriber); + foreach ($this->listener_collection as $listener) + { + $this->dispatcher->addSubscriber($listener); + } } } } -- cgit v1.2.1 From 13a4ceedb18ba938d3cd18e2f68707385bc9283a Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 13 Nov 2013 18:27:40 +0100 Subject: [ticket/11525] Use foreach instead of array_walk in method clean_row() This approach is cleaner and probably even faster the previous ways that included using array_walk() or array_map() and other helper functions and methods. PHPBB3-11525 --- phpBB/phpbb/avatar/manager.php | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/avatar/manager.php b/phpBB/phpbb/avatar/manager.php index 9f6a5fb089..12d7861cdf 100644 --- a/phpBB/phpbb/avatar/manager.php +++ b/phpBB/phpbb/avatar/manager.php @@ -195,33 +195,19 @@ class manager return self::$default_row; } - $keys = array_keys($row); - $values = array_values($row); - - array_walk($keys, array('\phpbb\avatar\manager', 'strip_prefix'), $prefix); - $row = array_combine($keys, $values); - - if ($prefix == 'group') + $output = array(); + foreach ($row as $key => $value) { - $row['id'] = 'g' . $row['id']; + $key = preg_replace("#^(?:{$prefix}_)#", '', $key); + $output[$key] = $value; } - return $row; - } + if ($prefix === 'group' && isset($output['id'])) + { + $output['id'] = 'g' . $output['id']; + } - /** - * Strip prepending user_ or group_ prefix from key - * - * @param string $key Array key - * @param string $null Parameter is ignored by the function, just required by the array_walk - * @param string $prefix Prefix that should be stripped off from the keys (e.g. user) - * Should not include the trailing underscore - * @return null - */ - static protected function strip_prefix(&$key, $null, $prefix) - { - $regex = ($prefix !== '') ? "#^(?:{$prefix}_)#" : '#^(?:user_|group_)#'; - $key = preg_replace($regex, '', $key); + return $output; } /** -- cgit v1.2.1 From 50896305fa9b5b0db733ae4a401c9bd0a85cabe9 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Wed, 13 Nov 2013 23:57:39 -0800 Subject: [ticket/12008] The read_notification_last_gc config setting should be dynamic. PHPBB3-12008 --- .../migration/data/v310/notifications_cron_p2.php | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v310/notifications_cron_p2.php (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/db/migration/data/v310/notifications_cron_p2.php b/phpBB/phpbb/db/migration/data/v310/notifications_cron_p2.php new file mode 100644 index 0000000000..050e679cc0 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/notifications_cron_p2.php @@ -0,0 +1,27 @@ + Date: Wed, 13 Nov 2013 23:58:21 -0800 Subject: [ticket/12008] Update the run time value for the prune notifications cron task PHPBB3-12008 --- phpBB/phpbb/notification/manager.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php index d77a936413..2e8652771b 100644 --- a/phpBB/phpbb/notification/manager.php +++ b/phpBB/phpbb/notification/manager.php @@ -27,6 +27,9 @@ class manager /** @var \phpbb\user_loader */ protected $user_loader; + /** @var \phpbb\config\config */ + protected $config; + /** @var \phpbb\db\driver\driver */ protected $db; @@ -58,6 +61,7 @@ class manager * @param array $notification_methods * @param ContainerBuilder $phpbb_container * @param \phpbb\user_loader $user_loader + * @param \phpbb\config\config $config * @param \phpbb\db\driver\driver $db * @param \phpbb\user $user * @param string $phpbb_root_path @@ -67,13 +71,14 @@ class manager * @param string $user_notifications_table * @return \phpbb\notification\manager */ - public function __construct($notification_types, $notification_methods, $phpbb_container, \phpbb\user_loader $user_loader, \phpbb\db\driver\driver $db, \phpbb\cache\service $cache, $user, $phpbb_root_path, $php_ext, $notification_types_table, $notifications_table, $user_notifications_table) + public function __construct($notification_types, $notification_methods, $phpbb_container, \phpbb\user_loader $user_loader, \phpbb\config\config $config, \phpbb\db\driver\driver $db, \phpbb\cache\service $cache, $user, $phpbb_root_path, $php_ext, $notification_types_table, $notifications_table, $user_notifications_table) { $this->notification_types = $notification_types; $this->notification_methods = $notification_methods; $this->phpbb_container = $phpbb_container; $this->user_loader = $user_loader; + $this->config = $config; $this->db = $db; $this->cache = $cache; $this->user = $user; @@ -797,6 +802,8 @@ class manager WHERE notification_time < ' . (int) $timestamp . (($only_read) ? ' AND notification_read = 1' : ''); $this->db->sql_query($sql); + + $this->config->set('read_notification_last_gc', time(), false); } /** -- cgit v1.2.1 From df6e03266fbe13e64a1f889136b6b1244b9111ae Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 14 Nov 2013 15:12:42 +0100 Subject: [ticket/11912] Remove obsolete "return null" in content_guesser PHPBB3-11912 --- phpBB/phpbb/mimetype/content_guesser.php | 2 -- 1 file changed, 2 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/mimetype/content_guesser.php b/phpBB/phpbb/mimetype/content_guesser.php index 623438ee0b..60e5a905e2 100644 --- a/phpBB/phpbb/mimetype/content_guesser.php +++ b/phpBB/phpbb/mimetype/content_guesser.php @@ -32,7 +32,5 @@ class content_guesser extends guesser_base { return mime_content_type($file); } - - return null; // optional } } -- cgit v1.2.1 From 23e2f920f5ed52cf9b354f61fcff548a03335ecc Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 14 Nov 2013 15:55:04 +0100 Subject: [ticket/12018] Use path_helper for admin style CSS in sql report The path to the admin style CSS is currently created with $phpbb_admin_path. We should however use the path_helper to correctly link to this file in order to have a correct link on pages like extensions PHPBB3-12018 --- phpBB/phpbb/db/driver/driver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php index 58d0b61519..d721ed2eb7 100644 --- a/phpBB/phpbb/db/driver/driver.php +++ b/phpBB/phpbb/db/driver/driver.php @@ -816,7 +816,7 @@ class driver */ function sql_report($mode, $query = '') { - global $cache, $starttime, $phpbb_root_path, $phpbb_admin_path, $user; + global $cache, $starttime, $phpbb_root_path, $phpbb_path_helper, $user; global $request; if (is_object($request) && !$request->variable('explain', false)) @@ -846,7 +846,7 @@ class driver SQL Report - +
-- cgit v1.2.1 From 7678186b0907e0852eabcd1f4ed2041a8a45060d Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 13 Nov 2013 23:19:47 +0100 Subject: [prep-release-3.1.0-a2] Add migration for 3.1.0-a2 --- phpBB/phpbb/db/migration/data/v310/alpha2.php | 28 +++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v310/alpha2.php (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/db/migration/data/v310/alpha2.php b/phpBB/phpbb/db/migration/data/v310/alpha2.php new file mode 100644 index 0000000000..3c0853f924 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/alpha2.php @@ -0,0 +1,28 @@ + Date: Wed, 20 Nov 2013 17:07:53 +0100 Subject: [ticket/11842] Add migration file for updating avatar type in database PHPBB3-11842 --- .../phpbb/db/migration/data/v310/avatar_types.php | 65 ++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v310/avatar_types.php (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/db/migration/data/v310/avatar_types.php b/phpBB/phpbb/db/migration/data/v310/avatar_types.php new file mode 100644 index 0000000000..439e20889c --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/avatar_types.php @@ -0,0 +1,65 @@ +table_prefix . "users + SET user_avatar_type = 'avatar.driver.upload' + WHERE user_avatar_type = " . AVATAR_UPLOAD; + $this->db->sql_query($sql); + + $sql = 'UPDATE ' . $this->table_prefix . "users + SET user_avatar_type = 'avatar.driver.remote' + WHERE user_avatar_type = " . AVATAR_REMOTE; + $this->db->sql_query($sql); + + $sql = 'UPDATE ' . $this->table_prefix . "users + SET user_avatar_type = 'avatar.driver.local' + WHERE user_avatar_type = " . AVATAR_GALLERY; + $this->db->sql_query($sql); + } + + public function update_group_avatar_type() + { + $sql = 'UPDATE ' . $this->table_prefix . "groups + SET group_avatar_type = 'avatar.driver.upload' + WHERE group_avatar_type = " . AVATAR_UPLOAD; + $this->db->sql_query($sql); + + $sql = 'UPDATE ' . $this->table_prefix . "groups + SET group_avatar_type = 'avatar.driver.remote' + WHERE group_avatar_type = " . AVATAR_REMOTE; + $this->db->sql_query($sql); + + $sql = 'UPDATE ' . $this->table_prefix . "groups + SET group_avatar_type = 'avatar.driver.local' + WHERE group_avatar_type = " . AVATAR_GALLERY; + $this->db->sql_query($sql); + } +} -- cgit v1.2.1 From 44b6f45759485cc33bb71ff50a715f39a8d60089 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Thu, 21 Nov 2013 08:11:17 -0800 Subject: [ticket/11484] Display login box for users following email notification link. The link used for the latest post now uses view=unread so redirecting the user using the value for the e parameter is no longer necessary. PHPBB3-11484 --- phpBB/phpbb/notification/type/post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/notification/type/post.php b/phpBB/phpbb/notification/type/post.php index 9d5c7b0a4c..c0ef184a19 100644 --- a/phpBB/phpbb/notification/type/post.php +++ b/phpBB/phpbb/notification/type/post.php @@ -234,7 +234,7 @@ class post extends \phpbb\notification\type\base 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('topic_title'))), 'U_VIEW_POST' => generate_board_url() . "/viewtopic.{$this->php_ext}?p={$this->item_id}#p{$this->item_id}", - 'U_NEWEST_POST' => generate_board_url() . "/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}&view=unread#unread", + 'U_NEWEST_POST' => generate_board_url() . "/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}&e=1&view=unread#unread", 'U_TOPIC' => generate_board_url() . "/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}", 'U_VIEW_TOPIC' => generate_board_url() . "/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}", 'U_FORUM' => generate_board_url() . "/viewforum.{$this->php_ext}?f={$this->get_data('forum_id')}", -- cgit v1.2.1 From bcf347420e4fe400d02a6ee58e63839f18a86362 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Thu, 21 Nov 2013 13:02:26 -0800 Subject: [ticket/11959] Trim the list of users from post notifications. PHPBB3-11959 --- phpBB/phpbb/notification/type/post.php | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/notification/type/post.php b/phpBB/phpbb/notification/type/post.php index 9d5c7b0a4c..0d07df8adf 100644 --- a/phpBB/phpbb/notification/type/post.php +++ b/phpBB/phpbb/notification/type/post.php @@ -183,6 +183,10 @@ class post extends \phpbb\notification\type\base 'username' => $this->get_data('post_username'), )), $responders); + $responders_cnt = sizeof($responders); + $responders = $this->trim_user_ary($responders); + $extra_cnt = $responders_cnt - sizeof($responders); + foreach ($responders as $responder) { if ($responder['username']) @@ -194,11 +198,18 @@ class post extends \phpbb\notification\type\base $usernames[] = $this->user_loader->get_username($responder['poster_id'], 'no_profile'); } } + $lang_key = $this->language_key; + + if ($responders_cnt > 4) + { + $lang_key .= '_TRIMMED'; + } return $this->user->lang( - $this->language_key, + $lang_key, implode(', ', $usernames), - censor_text($this->get_data('topic_title')) + censor_text($this->get_data('topic_title')), + $extra_cnt ); } @@ -272,6 +283,22 @@ class post extends \phpbb\notification\type\base } } + return $this->trim_user_ary($users); + } + + /** + * Trim the user array passed down to 3 users if the array contains + * more than 4 users. + * + * @param array $users Array of users + * @return array Trimmed array of user_ids + */ + public function trim_user_ary($users) + { + if (sizeof($users) > 4) + { + array_splice($users, 3); + } return $users; } -- cgit v1.2.1 From 43f454a6c6347827a01a1e31478a846ad05bc7f4 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Thu, 21 Nov 2013 13:15:08 -0800 Subject: [ticket/11959] Use COMMA_SEPARATOR to join the user list. PHPBB3-11959 --- phpBB/phpbb/notification/type/post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/notification/type/post.php b/phpBB/phpbb/notification/type/post.php index 0d07df8adf..e9f9d48978 100644 --- a/phpBB/phpbb/notification/type/post.php +++ b/phpBB/phpbb/notification/type/post.php @@ -207,7 +207,7 @@ class post extends \phpbb\notification\type\base return $this->user->lang( $lang_key, - implode(', ', $usernames), + implode($this->user->lang['COMMA_SEPARATOR'], $usernames), censor_text($this->get_data('topic_title')), $extra_cnt ); -- cgit v1.2.1 From e3a28e5e2a451794b322be90e1aef9ad4aee256b Mon Sep 17 00:00:00 2001 From: Cesar G Date: Thu, 21 Nov 2013 13:18:28 -0800 Subject: [ticket/11959] Rename $extra_cnt to something more descriptive. PHPBB3-11959 --- phpBB/phpbb/notification/type/post.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/notification/type/post.php b/phpBB/phpbb/notification/type/post.php index e9f9d48978..87bd4331b6 100644 --- a/phpBB/phpbb/notification/type/post.php +++ b/phpBB/phpbb/notification/type/post.php @@ -185,7 +185,7 @@ class post extends \phpbb\notification\type\base $responders_cnt = sizeof($responders); $responders = $this->trim_user_ary($responders); - $extra_cnt = $responders_cnt - sizeof($responders); + $trimmed_responders_cnt = $responders_cnt - sizeof($responders); foreach ($responders as $responder) { @@ -200,7 +200,7 @@ class post extends \phpbb\notification\type\base } $lang_key = $this->language_key; - if ($responders_cnt > 4) + if ($trimmed_responders_cnt) { $lang_key .= '_TRIMMED'; } @@ -209,7 +209,7 @@ class post extends \phpbb\notification\type\base $lang_key, implode($this->user->lang['COMMA_SEPARATOR'], $usernames), censor_text($this->get_data('topic_title')), - $extra_cnt + $trimmed_responders_cnt ); } -- cgit v1.2.1 From e108418824857e670a92f516285455f79bf6e12a Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 23 Nov 2013 00:51:29 +0100 Subject: [ticket/11912] Check if content_guesser is supported with function_exists PHPBB3-11912 --- phpBB/phpbb/mimetype/content_guesser.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/mimetype/content_guesser.php b/phpBB/phpbb/mimetype/content_guesser.php index 60e5a905e2..2d74582a21 100644 --- a/phpBB/phpbb/mimetype/content_guesser.php +++ b/phpBB/phpbb/mimetype/content_guesser.php @@ -20,7 +20,7 @@ class content_guesser extends guesser_base */ public function is_supported() { - return true; + return function_exists('mime_content_type'); } /** @@ -28,9 +28,6 @@ class content_guesser extends guesser_base */ public function guess($file, $file_name = '') { - if (function_exists('mime_content_type')) - { - return mime_content_type($file); - } + return mime_content_type($file); } } -- cgit v1.2.1 From 0d4bf3ff45a76dcb763c76502944aa7bf78b690b Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 25 Nov 2013 13:12:08 +0100 Subject: [ticket/11842] Use type map for updating avatar types in database PHPBB3-11842 --- .../phpbb/db/migration/data/v310/avatar_types.php | 51 ++++++++++------------ 1 file changed, 23 insertions(+), 28 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/db/migration/data/v310/avatar_types.php b/phpBB/phpbb/db/migration/data/v310/avatar_types.php index 439e20889c..5750a43ddd 100644 --- a/phpBB/phpbb/db/migration/data/v310/avatar_types.php +++ b/phpBB/phpbb/db/migration/data/v310/avatar_types.php @@ -11,6 +11,15 @@ namespace phpbb\db\migration\data\v310; class avatar_types extends \phpbb\db\migration\migration { + /** + * @var avatar type map + */ + protected $avatar_type_map = array( + AVATAR_UPLOAD => 'avatar.driver.upload', + AVATAR_REMOTE => 'avatar.driver.remote', + AVATAR_GALLERY => 'avatar.driver.local', + ); + static public function depends_on() { return array( @@ -29,37 +38,23 @@ class avatar_types extends \phpbb\db\migration\migration public function update_user_avatar_type() { - $sql = 'UPDATE ' . $this->table_prefix . "users - SET user_avatar_type = 'avatar.driver.upload' - WHERE user_avatar_type = " . AVATAR_UPLOAD; - $this->db->sql_query($sql); - - $sql = 'UPDATE ' . $this->table_prefix . "users - SET user_avatar_type = 'avatar.driver.remote' - WHERE user_avatar_type = " . AVATAR_REMOTE; - $this->db->sql_query($sql); - - $sql = 'UPDATE ' . $this->table_prefix . "users - SET user_avatar_type = 'avatar.driver.local' - WHERE user_avatar_type = " . AVATAR_GALLERY; - $this->db->sql_query($sql); + foreach ($this->avatar_type_map as $old => $new) + { + $sql = 'UPDATE ' . $this->table_prefix . "users + SET user_avatar_type = '$new' + WHERE user_avatar_type = $old"; + $this->db->sql_query($sql); + } } public function update_group_avatar_type() { - $sql = 'UPDATE ' . $this->table_prefix . "groups - SET group_avatar_type = 'avatar.driver.upload' - WHERE group_avatar_type = " . AVATAR_UPLOAD; - $this->db->sql_query($sql); - - $sql = 'UPDATE ' . $this->table_prefix . "groups - SET group_avatar_type = 'avatar.driver.remote' - WHERE group_avatar_type = " . AVATAR_REMOTE; - $this->db->sql_query($sql); - - $sql = 'UPDATE ' . $this->table_prefix . "groups - SET group_avatar_type = 'avatar.driver.local' - WHERE group_avatar_type = " . AVATAR_GALLERY; - $this->db->sql_query($sql); + foreach ($this->avatar_type_map as $old => $new) + { + $sql = 'UPDATE ' . $this->table_prefix . "groups + SET group_avatar_type = '$new' + WHERE group_avatar_type = $old"; + $this->db->sql_query($sql); + } } } -- cgit v1.2.1 From 6618f0ea246100c55636ef679df55d2c951dfbc0 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 27 Nov 2013 15:18:42 +0100 Subject: [ticket/11859] Make avatar drivers return template filename The service name might not follow the expected naming scheme which would cause abnormally long filenames and confusion for authors that might add more avatar drivers. PHPBB3-11859 --- phpBB/phpbb/avatar/driver/driver.php | 11 ----------- phpBB/phpbb/avatar/driver/gravatar.php | 8 ++++++++ phpBB/phpbb/avatar/driver/local.php | 8 ++++++++ phpBB/phpbb/avatar/driver/remote.php | 8 ++++++++ phpBB/phpbb/avatar/driver/upload.php | 8 ++++++++ 5 files changed, 32 insertions(+), 11 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/avatar/driver/driver.php b/phpBB/phpbb/avatar/driver/driver.php index d360614122..dd55f09119 100644 --- a/phpBB/phpbb/avatar/driver/driver.php +++ b/phpBB/phpbb/avatar/driver/driver.php @@ -109,17 +109,6 @@ abstract class driver implements \phpbb\avatar\driver\driver_interface return true; } - /** - * @inheritdoc - */ - public function get_template_name() - { - $driver = preg_replace('#^phpbb\\\\avatar\\\\driver\\\\#', '', get_class($this)); - $template = "ucp_avatar_options_$driver.html"; - - return $template; - } - /** * @inheritdoc */ diff --git a/phpBB/phpbb/avatar/driver/gravatar.php b/phpBB/phpbb/avatar/driver/gravatar.php index d64f4da734..9f14b7f468 100644 --- a/phpBB/phpbb/avatar/driver/gravatar.php +++ b/phpBB/phpbb/avatar/driver/gravatar.php @@ -146,6 +146,14 @@ class gravatar extends \phpbb\avatar\driver\driver ); } + /** + * @inheritdoc + */ + public function get_template_name() + { + return 'ucp_avatar_options_gravatar.html'; + } + /** * Build gravatar URL for output on page * diff --git a/phpBB/phpbb/avatar/driver/local.php b/phpBB/phpbb/avatar/driver/local.php index f6acc6e636..611a44cb3d 100644 --- a/phpBB/phpbb/avatar/driver/local.php +++ b/phpBB/phpbb/avatar/driver/local.php @@ -134,6 +134,14 @@ class local extends \phpbb\avatar\driver\driver ); } + /** + * @inheritdoc + */ + public function get_template_name() + { + return 'ucp_avatar_options_local.html'; + } + /** * Get a list of avatars that are locally available * Results get cached for 24 hours (86400 seconds) diff --git a/phpBB/phpbb/avatar/driver/remote.php b/phpBB/phpbb/avatar/driver/remote.php index 22d50c703e..36623942df 100644 --- a/phpBB/phpbb/avatar/driver/remote.php +++ b/phpBB/phpbb/avatar/driver/remote.php @@ -186,4 +186,12 @@ class remote extends \phpbb\avatar\driver\driver 'avatar_height' => $height, ); } + + /** + * @inheritdoc + */ + public function get_template_name() + { + return 'ucp_avatar_options_remote.html'; + } } diff --git a/phpBB/phpbb/avatar/driver/upload.php b/phpBB/phpbb/avatar/driver/upload.php index 822c40af98..1e50e135e4 100644 --- a/phpBB/phpbb/avatar/driver/upload.php +++ b/phpBB/phpbb/avatar/driver/upload.php @@ -167,6 +167,14 @@ class upload extends \phpbb\avatar\driver\driver return true; } + /** + * @inheritdoc + */ + public function get_template_name() + { + return 'ucp_avatar_options_upload.html'; + } + /** * Check if user is able to upload an avatar * -- cgit v1.2.1 From 53be0a4432aa04b916c7e9d08785f97d8e6eb355 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 4 Dec 2013 23:40:38 +0100 Subject: [ticket/12058] Add missing apostrophe to avatar_types migration queries PHPBB3-12058 --- phpBB/phpbb/db/migration/data/v310/avatar_types.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/db/migration/data/v310/avatar_types.php b/phpBB/phpbb/db/migration/data/v310/avatar_types.php index 5750a43ddd..bdbdccf0c5 100644 --- a/phpBB/phpbb/db/migration/data/v310/avatar_types.php +++ b/phpBB/phpbb/db/migration/data/v310/avatar_types.php @@ -42,7 +42,7 @@ class avatar_types extends \phpbb\db\migration\migration { $sql = 'UPDATE ' . $this->table_prefix . "users SET user_avatar_type = '$new' - WHERE user_avatar_type = $old"; + WHERE user_avatar_type = '$old'"; $this->db->sql_query($sql); } } @@ -53,7 +53,7 @@ class avatar_types extends \phpbb\db\migration\migration { $sql = 'UPDATE ' . $this->table_prefix . "groups SET group_avatar_type = '$new' - WHERE group_avatar_type = $old"; + WHERE group_avatar_type = '$old'"; $this->db->sql_query($sql); } } -- cgit v1.2.1