Merge "(Bug 45355) Read of arbitrary files through mwdoc-filter.php"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 4 Mar 2013 19:43:11 +0000 (19:43 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 4 Mar 2013 19:43:11 +0000 (19:43 +0000)
maintenance/mwdoc-filter.php

index ab05a3e..6eeb48d 100644 (file)
  * @file
  */
 
+if ( PHP_SAPI != 'cli' ) {
+       die( "This filter can only be run from the command line.\n" );
+}
+
 $source = file_get_contents( $argv[1] );
 $regexp = '#\@var\s+([^\s]+)([^/]+)/\s+(var|public|protected|private)\s+(\$[^\s;=]+)#';
 $replac = '${2} */ ${3} ${1} ${4}';