Index: trunk/extensions/Wikidata/App.php |
— | — | @@ -4,6 +4,12 @@ |
5 | 5 | # CONFIGURATION VARIABLES TO LocalApp.php AND EDIT THEM |
6 | 6 | # THERE. |
7 | 7 | |
| 8 | +/** |
| 9 | + * Protect against register_globals vulnerabilities. |
| 10 | + * This line must be present before any global variable is referenced. |
| 11 | + */ |
| 12 | +if (!defined('MEDIAWIKI')) die(); |
| 13 | + |
8 | 14 | $wgDefaultGoPrefix='Expression:'; |
9 | 15 | $wgHooks['BeforePageDisplay'][]='addWikidataHeader'; |
10 | 16 | $wgHooks['GetEditLinkTrail'][]='addWikidataEditLinkTrail'; #TODO merge with modifyTabs |
Index: trunk/extensions/php/ext/MediaWiki/MediaWiki.php |
— | — | @@ -1,4 +1,10 @@ |
2 | 2 | <? |
| 3 | + |
| 4 | +if ( php_sapi_name() != 'cli' ) { |
| 5 | + echo "This script must be run from the command line\n"; |
| 6 | + exit( 1 ); |
| 7 | +} |
| 8 | + |
3 | 9 | if(!extension_loaded('MediaWiki')) { |
4 | 10 | dl('MediaWiki.' . PHP_SHLIB_SUFFIX); |
5 | 11 | } |
Index: trunk/extensions/CategoryIntersection/CategoryIntersection.php |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | if (!defined('MEDIAWIKI')) { |
22 | 22 | echo <<<EOT |
23 | 23 | To install my extension, put the following line in LocalSettings.php: |
24 | | -require_once("$IP/extensions/CategoryIntersection/CategoryIntersection.php"); |
| 24 | +require_once("\$IP/extensions/CategoryIntersection/CategoryIntersection.php"); |
25 | 25 | EOT; |
26 | 26 | exit(1); |
27 | 27 | } |
Index: trunk/extensions/TemplateLink/TemplateLink.setup.php |
— | — | @@ -13,7 +13,7 @@ |
14 | 14 | if(!defined('MEDIAWIKI')){ |
15 | 15 | echo <<<EOT |
16 | 16 | To install my extension, put the following line in LocalSettings.php: |
17 | | -require_once( "$IP/extensions/TemplateLink/TemplateLink.setup.php" ); |
| 17 | +require_once( "\$IP/extensions/TemplateLink/TemplateLink.setup.php" ); |
18 | 18 | EOT; |
19 | 19 | exit( 1 ); |
20 | 20 | } |
Index: trunk/extensions/SyntaxHighlight_vim/SyntaxHook.php |
— | — | @@ -28,10 +28,10 @@ |
29 | 29 | private function setHook() { |
30 | 30 | global $wgParser; |
31 | 31 | |
32 | | - $wgParser->setHook( 'syntax', array( $this, 'syntaxHook' ) ); |
| 32 | + $wgParser->setHook( 'syntax', array( $this, 'hook' ) ); |
33 | 33 | } |
34 | 34 | |
35 | | - public function syntaxHook( $in, array $argv ) { |
| 35 | + public function hook( $in, array $argv ) { |
36 | 36 | $in = ltrim( $in, "\n" ); |
37 | 37 | $syntax = new Syntax( $in ); |
38 | 38 | |
Index: trunk/extensions/wikihiero/wh_generate.php |
— | — | @@ -32,7 +32,7 @@ |
33 | 33 | $lang = "fr"; |
34 | 34 | } |
35 | 35 | ?> |
36 | | -<html lang=<?php echo $lang; ?>> |
| 36 | +<html lang=<?php echo htmlspecialchars( $lang ); ?>> |
37 | 37 | <head> |
38 | 38 | <title>WikiHiero - Table generator</title> |
39 | 39 | <meta http-equiv="Content-type" content="text/html; charset=UTF-8"> |
Index: trunk/extensions/wikihiero/wh_table.php |
— | — | @@ -61,9 +61,9 @@ |
62 | 62 | } |
63 | 63 | |
64 | 64 | ?> |
65 | | -<html lang=<?php echo $lang; ?>> |
| 65 | +<html lang=<?php echo htmlspecialchars($lang); ?>> |
66 | 66 | <head> |
67 | | - <title><?php echo "$table - ".WH_Text($table); ?> - WikiHiero</title> |
| 67 | + <title><?php echo htmlspecialchars($table)." - ".WH_Text($table); ?> - WikiHiero</title> |
68 | 68 | <meta http-equiv="Content-type" content="text/html; charset=UTF-8"> |
69 | 69 | <link rel="shortcut icon" href="https://www.mediawiki.org/favicon.ico"> |
70 | 70 | </head> |
— | — | @@ -71,7 +71,7 @@ |
72 | 72 | |
73 | 73 | <?php |
74 | 74 | |
75 | | - echo "<b>$table</b> - ".WH_Text($table)."<br /><br />"; |
| 75 | + echo "<b>" . htmlspecialchars( $table ) . "</b> - ".WH_Text($table)."<br /><br />"; |
76 | 76 | |
77 | 77 | if($dh = opendir(WH_IMG_DIR)) { |
78 | 78 | while(($file = readdir($dh)) !== false) { |
— | — | @@ -79,15 +79,20 @@ |
80 | 80 | { |
81 | 81 | $code = WH_GetCode($file); |
82 | 82 | if(in_array($code, $wh_phonemes)) |
83 | | - echo "<img src=\"".WH_IMG_DIR."$file\" title=\"$code [".array_search($code, $wh_phonemes)."]\">\n"; |
| 83 | + echo "<img src=\"".htmlspecialchars( WH_IMG_DIR.$file ) . "\" " . |
| 84 | + "title=\"" . htmlspecialchars( $code ) . " [". |
| 85 | + htmlspecialchars( array_search($code, $wh_phonemes) ) . "]\">\n"; |
84 | 86 | else |
85 | | - echo "<img src=\"".WH_IMG_DIR."$file\" title=\"$code\">\n"; |
| 87 | + echo "<img src=\"".htmlspecialchars( WH_IMG_DIR.$file ) . "\" title=\"" . |
| 88 | + htmlspecialchars( $code ) . "\">\n"; |
86 | 89 | } |
87 | 90 | else if($table == "Phoneme") |
88 | 91 | { |
89 | 92 | $code = WH_GetCode($file); |
90 | 93 | if(in_array($code, $wh_phonemes)) |
91 | | - echo "<img src=\"".WH_IMG_DIR."$file\" title=\"$code [".array_search($code, $wh_phonemes)."]\">\n"; |
| 94 | + echo "<img src=\"".htmlspecialchars( WH_IMG_DIR.$file ) . "\" " . |
| 95 | + "title=\"" . htmlspecialchars( $code ) . " [". |
| 96 | + htmlspecialchars( array_search($code, $wh_phonemes) )."]\">\n"; |
92 | 97 | } |
93 | 98 | else if($table == "Aa") |
94 | 99 | { |
— | — | @@ -95,9 +100,12 @@ |
96 | 101 | if((substr($code, 0, 2) == $table) && ctype_digit($code[2])) |
97 | 102 | { |
98 | 103 | if(in_array($code, $wh_phonemes)) |
99 | | - echo "<img src=\"".WH_IMG_DIR."$file\" title=\"$code [".array_search($code, $wh_phonemes)."]\">\n"; |
| 104 | + echo "<img src=\"".htmlspecialchars( WH_IMG_DIR.$file) . "\" title=\"" . |
| 105 | + htmlspecialchars( $code ) . " [". |
| 106 | + htmlspecialchars( array_search($code, $wh_phonemes) )."]\">\n"; |
100 | 107 | else |
101 | | - echo "<img src=\"".WH_IMG_DIR."$file\" title=\"$code\">\n"; |
| 108 | + echo "<img src=\"".htmlspecialchars( WH_IMG_DIR.$file ) . "\" title=\"" . |
| 109 | + htmlspecialchars( $code ) . "\">\n"; |
102 | 110 | } |
103 | 111 | } |
104 | 112 | else |
— | — | @@ -106,9 +114,12 @@ |
107 | 115 | if(($code[0] == $table) && ctype_digit($code[1])) |
108 | 116 | { |
109 | 117 | if(in_array($code, $wh_phonemes)) |
110 | | - echo "<img src=\"".WH_IMG_DIR."$file\" title=\"$code [".array_search($code, $wh_phonemes)."]\">\n"; |
| 118 | + echo "<img src=\"".htmlspecialchars( WH_IMG_DIR.$file ) . "\" title=\"" . |
| 119 | + htmlspecialchars( $code ) . "[". |
| 120 | + htmlspecialchars( array_search($code, $wh_phonemes) )."]\">\n"; |
111 | 121 | else |
112 | | - echo "<img src=\"".WH_IMG_DIR."$file\" title=\"$code\">\n"; |
| 122 | + echo "<img src=\"".htmlspecialchars( WH_IMG_DIR.$file ). "\" title=\"" . |
| 123 | + htmlspecialchars( $code ) . "\">\n"; |
113 | 124 | } |
114 | 125 | } |
115 | 126 | } |
Index: trunk/extensions/wikihiero/index.php |
— | — | @@ -24,9 +24,14 @@ |
25 | 25 | // |
26 | 26 | ////////////////////////////////////////////////////////////////////////// |
27 | 27 | |
| 28 | +$IP = getenv( 'MW_INSTALL_PATH' ); |
| 29 | +if ( $IP === false ) { |
| 30 | + $IP = dirname( __FILE__ ) .'/../..'; |
| 31 | +} |
| 32 | +require( "$IP/includes/WebStart.php" ); |
| 33 | + |
28 | 34 | require('wh_language.php'); |
29 | 35 | require('wikihiero.php'); |
30 | | - |
31 | 36 | # |
32 | 37 | # Initialization from request |
33 | 38 | # |
— | — | @@ -91,7 +96,9 @@ |
92 | 97 | |
93 | 98 | function WH_Table( $table ) { |
94 | 99 | global $lang; |
95 | | - echo "<a href=\"#\" onClick=\"MyWindow=window.open('wh_table.php?table=$table&lang=$lang','$table','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=400,height=300,left=20,top=20'); return false;\" title =\"".WH_Text($table)."\">$table</a>"; |
| 100 | + $url = "wh_table.php?table=" . urlencode( $table ) . '&lang=' . urlencode( $lang ); |
| 101 | + $encUrl = htmlspecialchars( Xml::encodeJsVar( $url ) ); |
| 102 | + echo "<a href=\"#\" onClick=\"MyWindow=window.open($encUrl,'$table','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=400,height=300,left=20,top=20'); return false;\" title =\"".WH_Text($table)."\">$table</a>"; |
96 | 103 | } |
97 | 104 | |
98 | 105 | # |
— | — | @@ -160,9 +167,9 @@ |
161 | 168 | <option disabled value="2" <?php if($mode==2) echo "selected"; ?> title="<?php echo WH_Text("CSS"); ?>">HTML & CSS |
162 | 169 | <option disabled value="3" <?php if($mode==3) echo "selected"; ?> title="<?php echo WH_Text("Image"); ?>">Image |
163 | 170 | </select> |
164 | | - <?php echo WH_Text("Scale"); ?><input type="range" name="scale" <?php if($mode==0) echo "disabled"; ?> title="<?php echo WH_Text("Size"); ?>" min="1" max="999" size="3" maxlength="3" value="<?php echo $scale; ?>">% |
| 171 | + <?php echo WH_Text("Scale"); ?><input type="range" name="scale" <?php if($mode==0) echo "disabled"; ?> title="<?php echo WH_Text("Size"); ?>" min="1" max="999" size="3" maxlength="3" value="<?php echo htmlspecialchars( $scale ); ?>">% |
165 | 172 | <?php echo WH_Text("Line"); ?><input type="checkbox" name="line" <?php if($line) echo "checked"; ?>> |
166 | | - <input type="hidden" name="lang" value="<?php echo $lang; ?>"> |
| 173 | + <input type="hidden" name="lang" value="<?php echo htmlspecialchars( $lang ); ?>"> |
167 | 174 | </form> |
168 | 175 | |
169 | 176 | </td><td valign="top"> |
Index: trunk/extensions/StalePages/StalePages_body.php |
— | — | @@ -12,9 +12,6 @@ |
13 | 13 | * @author Tim Laqua <t.laqua@gmail.com> |
14 | 14 | */ |
15 | 15 | |
16 | | -global $wgHooks, $IP; |
17 | | -require_once "$IP/includes/QueryPage.php"; |
18 | | - |
19 | 16 | class Stalepages extends SpecialPage |
20 | 17 | { |
21 | 18 | ///StalePages Class Constructor |
Index: trunk/extensions/TodoTasks/SpecialTaskList_body.php |
— | — | @@ -279,8 +279,6 @@ |
280 | 280 | } |
281 | 281 | |
282 | 282 | |
283 | | -require_once("$IP/includes/SpecialPage.php"); |
284 | | - |
285 | 283 | class TaskList extends SpecialPage |
286 | 284 | { |
287 | 285 | function TaskList() { |
Index: trunk/extensions/WatchSubpages/WatchSubpages.php |
— | — | @@ -10,7 +10,7 @@ |
11 | 11 | if (!defined('MEDIAWIKI')) { |
12 | 12 | echo <<<EOT |
13 | 13 | To install my extension, put the following line in LocalSettings.php: |
14 | | -require_once( "$IP/extensions/WatchSubpages/WatchSubpages.php" ); |
| 14 | +require_once( "\$IP/extensions/WatchSubpages/WatchSubpages.php" ); |
15 | 15 | EOT; |
16 | 16 | exit( 1 ); |
17 | 17 | } |
Index: trunk/extensions/ChangeAuthor/ChangeAuthor.setup.php |
— | — | @@ -18,7 +18,7 @@ |
19 | 19 | if (!defined('MEDIAWIKI')) { |
20 | 20 | echo <<<EOT |
21 | 21 | To install the ChangeAuthor extension, put the following line in LocalSettings.php: |
22 | | -require_once( "$IP/extensions/ChangeAuthor/ChangeAuthor.setup.php" ); |
| 22 | +require_once( "\$IP/extensions/ChangeAuthor/ChangeAuthor.setup.php" ); |
23 | 23 | EOT; |
24 | 24 | exit(1); |
25 | 25 | } |
Index: trunk/extensions/ChangeAuthor/ChangeAuthor.body.php |
— | — | @@ -18,7 +18,7 @@ |
19 | 19 | if (!defined('MEDIAWIKI')) { |
20 | 20 | echo <<<EOT |
21 | 21 | To install the ChangeAuthor extension, put the following line in LocalSettings.php: |
22 | | -require_once( "$IP/extensions/ChangeAuthor/ChangeAuthor.setup.php" ); |
| 22 | +require_once( "\$IP/extensions/ChangeAuthor/ChangeAuthor.setup.php" ); |
23 | 23 | EOT; |
24 | 24 | exit(1); |
25 | 25 | } |
Index: trunk/extensions/ChangeAuthor/ChangeAuthor.i18n.php |
— | — | @@ -18,7 +18,7 @@ |
19 | 19 | if (!defined('MEDIAWIKI')) { |
20 | 20 | echo <<<EOT |
21 | 21 | To install the ChangeAuthor extension, put the following line in LocalSettings.php: |
22 | | -require_once( "$IP/extensions/ChangeAuthor/ChangeAuthor.setup.php" ); |
| 22 | +require_once( "\$IP/extensions/ChangeAuthor/ChangeAuthor.setup.php" ); |
23 | 23 | EOT; |
24 | 24 | exit(1); |
25 | 25 | } |
Index: trunk/extensions/Call/Call.php |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | if (!defined('MEDIAWIKI')) { |
10 | 10 | echo <<<EOT |
11 | 11 | To install Call as a special page, put the following line in LocalSettings.php: |
12 | | -require_once( "$IP/extensions/Call/Call.php" ); |
| 12 | +require_once( "\$IP/extensions/Call/Call.php" ); |
13 | 13 | EOT; |
14 | 14 | exit( 1 ); |
15 | 15 | } |
Index: trunk/extensions/Makebot/Makebot.class.php |
— | — | @@ -1,9 +1,5 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -global $IP; |
5 | | -require_once( "$IP/includes/LogPage.php" ); |
6 | | -require_once( "$IP/includes/SpecialLog.php" ); |
7 | | - |
8 | 4 | class MakeBot extends SpecialPage { |
9 | 5 | |
10 | 6 | var $target = ''; |
Index: trunk/extensions/SemanticCalendar/includes/SC_Settings.php |
— | — | @@ -1,5 +1,11 @@ |
2 | 2 | <?php |
| 3 | +/** |
| 4 | + * Protect against register_globals vulnerabilities. |
| 5 | + * This line must be present before any global variable is referenced. |
| 6 | + */ |
| 7 | +if (!defined('MEDIAWIKI')) die(); |
3 | 8 | |
| 9 | + |
4 | 10 | ### |
5 | 11 | # This is the path to your installation of Semantic Calendar as |
6 | 12 | # seen from the web. Change it if required ($wgScriptPath is the |
Index: trunk/extensions/PasswordReset/PasswordReset_Disabledusers.php |
— | — | @@ -12,9 +12,6 @@ |
13 | 13 | * @author Tim Laqua <t.laqua@gmail.com> |
14 | 14 | */ |
15 | 15 | |
16 | | -global $wgHooks, $IP; |
17 | | -require_once "$IP/includes/QueryPage.php"; |
18 | | - |
19 | 16 | class Disabledusers extends SpecialPage { |
20 | 17 | ///StalePages Class Constructor |
21 | 18 | public function __construct() { |
Index: trunk/extensions/regexBlock/regexBlock.php |
— | — | @@ -8,8 +8,14 @@ |
9 | 9 | * @author Bartek Łapiński |
10 | 10 | * @copyright Copyright © 2007, Wikia Inc. |
11 | 11 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
12 | | -*/ |
| 12 | + */ |
13 | 13 | |
| 14 | +/** |
| 15 | + * Protect against register_globals vulnerabilities. |
| 16 | + * This line must be present before any global variable is referenced. |
| 17 | + */ |
| 18 | +if (!defined('MEDIAWIKI')) die(); |
| 19 | + |
14 | 20 | /* generic reasons */ |
15 | 21 | |
16 | 22 | global $wgContactLink; |
— | — | @@ -67,4 +73,4 @@ |
68 | 74 | require_once ($IP.REGEXBLOCK_PATH."extensions/regexBlock/SpecialRegexBlockStats.php"); |
69 | 75 | |
70 | 76 | /* simplified regexes, this is shared with SpamRegex */ |
71 | | -require_once ($IP.REGEXBLOCK_PATH."extensions/SimplifiedRegex/SimplifiedRegex.php"); |
\ No newline at end of file |
| 77 | +require_once ($IP.REGEXBLOCK_PATH."extensions/SimplifiedRegex/SimplifiedRegex.php"); |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php |
— | — | @@ -6,6 +6,12 @@ |
7 | 7 | * @author Markus Krötzsch |
8 | 8 | */ |
9 | 9 | |
| 10 | +/** |
| 11 | + * Protect against register_globals vulnerabilities. |
| 12 | + * This line must be present before any global variable is referenced. |
| 13 | + */ |
| 14 | +if (!defined('MEDIAWIKI')) die(); |
| 15 | + |
10 | 16 | global $smwgIP; |
11 | 17 | require_once($smwgIP . '/includes/storage/SMW_Store.php'); |
12 | 18 | |
Index: trunk/extensions/SemanticMediaWiki/includes/jobs/SMW_DummyJob.php |
— | — | @@ -11,10 +11,6 @@ |
12 | 12 | * |
13 | 13 | * @author Daniel M. Herzig |
14 | 14 | */ |
15 | | - |
16 | | -global $IP; |
17 | | -require_once ($IP."/includes/JobQueue.php"); |
18 | | - |
19 | 15 | class SMW_DummyJob extends Job { |
20 | 16 | |
21 | 17 | //Constructor |
— | — | @@ -33,4 +29,4 @@ |
34 | 30 | |
35 | 31 | return true; |
36 | 32 | } |
37 | | -} |
\ No newline at end of file |
| 33 | +} |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Factbox.php |
— | — | @@ -6,6 +6,12 @@ |
7 | 7 | * @author Markus Krötzsch |
8 | 8 | */ |
9 | 9 | |
| 10 | +/** |
| 11 | + * Protect against register_globals vulnerabilities. |
| 12 | + * This line must be present before any global variable is referenced. |
| 13 | + */ |
| 14 | +if (!defined('MEDIAWIKI')) die(); |
| 15 | + |
10 | 16 | global $smwgIP; |
11 | 17 | include_once($smwgIP . '/includes/SMW_SemanticData.php'); |
12 | 18 | |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php |
— | — | @@ -5,6 +5,12 @@ |
6 | 6 | * @author Markus Krötzsch |
7 | 7 | */ |
8 | 8 | |
| 9 | +/** |
| 10 | + * Protect against register_globals vulnerabilities. |
| 11 | + * This line must be present before any global variable is referenced. |
| 12 | + */ |
| 13 | +if (!defined('MEDIAWIKI')) die(); |
| 14 | + |
9 | 15 | global $smwgIP; |
10 | 16 | require_once( "$smwgIP/includes/storage/SMW_Store.php" ); |
11 | 17 | require_once( "$smwgIP/includes/SMW_DataValueFactory.php" ); |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_Query.php |
— | — | @@ -6,6 +6,12 @@ |
7 | 7 | * @author Markus Krötzsch |
8 | 8 | */ |
9 | 9 | |
| 10 | +/** |
| 11 | + * Protect against register_globals vulnerabilities. |
| 12 | + * This line must be present before any global variable is referenced. |
| 13 | + */ |
| 14 | +if (!defined('MEDIAWIKI')) die(); |
| 15 | + |
10 | 16 | global $smwgIP; |
11 | 17 | require_once($smwgIP . '/includes/storage/SMW_Description.php'); |
12 | 18 | |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore.php |
— | — | @@ -5,6 +5,12 @@ |
6 | 6 | * @author Markus Krötzsch |
7 | 7 | */ |
8 | 8 | |
| 9 | +/** |
| 10 | + * Protect against register_globals vulnerabilities. |
| 11 | + * This line must be present before any global variable is referenced. |
| 12 | + */ |
| 13 | +if (!defined('MEDIAWIKI')) die(); |
| 14 | + |
9 | 15 | global $smwgIP; |
10 | 16 | require_once( "$smwgIP/includes/storage/SMW_Store.php" ); |
11 | 17 | require_once( "$smwgIP/includes/SMW_DataValueFactory.php" ); |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_Store.php |
— | — | @@ -5,6 +5,12 @@ |
6 | 6 | * @author Markus Krötzsch |
7 | 7 | */ |
8 | 8 | |
| 9 | +/** |
| 10 | + * Protect against register_globals vulnerabilities. |
| 11 | + * This line must be present before any global variable is referenced. |
| 12 | + */ |
| 13 | +if (!defined('MEDIAWIKI')) die(); |
| 14 | + |
9 | 15 | global $smwgIP; |
10 | 16 | require_once($smwgIP . '/includes/SMW_SemanticData.php'); |
11 | 17 | require_once($smwgIP . '/includes/storage/SMW_Query.php'); |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_TestStore.php |
— | — | @@ -6,6 +6,12 @@ |
7 | 7 | * @author Markus Krötzsch |
8 | 8 | */ |
9 | 9 | |
| 10 | +/** |
| 11 | + * Protect against register_globals vulnerabilities. |
| 12 | + * This line must be present before any global variable is referenced. |
| 13 | + */ |
| 14 | +if (!defined('MEDIAWIKI')) die(); |
| 15 | + |
10 | 16 | global $smwgIP; |
11 | 17 | require_once( "$smwgIP/includes/storage/SMW_Store.php" ); |
12 | 18 | |
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguagePl.php |
— | — | @@ -22,6 +22,13 @@ |
23 | 23 | * on this site = w tym miejscu |
24 | 24 | */ |
25 | 25 | |
| 26 | +/** |
| 27 | + * Protect against register_globals vulnerabilities. |
| 28 | + * This line must be present before any global variable is referenced. |
| 29 | + */ |
| 30 | +if (!defined('MEDIAWIKI')) die(); |
| 31 | + |
| 32 | + |
26 | 33 | global $smwgIP; |
27 | 34 | include_once($smwgIP . '/languages/SMW_Language.php'); |
28 | 35 | |
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageIt.php |
— | — | @@ -3,6 +3,12 @@ |
4 | 4 | * @author Davide Eynard, David Laniado |
5 | 5 | */ |
6 | 6 | |
| 7 | +/** |
| 8 | + * Protect against register_globals vulnerabilities. |
| 9 | + * This line must be present before any global variable is referenced. |
| 10 | + */ |
| 11 | +if (!defined('MEDIAWIKI')) die(); |
| 12 | + |
7 | 13 | global $smwgIP; |
8 | 14 | include_once($smwgIP . '/languages/SMW_Language.php'); |
9 | 15 | |
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageSk.php |
— | — | @@ -3,6 +3,12 @@ |
4 | 4 | * @author helix84 |
5 | 5 | */ |
6 | 6 | |
| 7 | +/** |
| 8 | + * Protect against register_globals vulnerabilities. |
| 9 | + * This line must be present before any global variable is referenced. |
| 10 | + */ |
| 11 | +if (!defined('MEDIAWIKI')) die(); |
| 12 | + |
7 | 13 | global $smwgIP; |
8 | 14 | include_once($smwgIP . '/languages/SMW_Language.php'); |
9 | 15 | |
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageRu.php |
— | — | @@ -4,6 +4,12 @@ |
5 | 5 | * @author cnit@uniyar.ac.ru |
6 | 6 | */ |
7 | 7 | |
| 8 | +/** |
| 9 | + * Protect against register_globals vulnerabilities. |
| 10 | + * This line must be present before any global variable is referenced. |
| 11 | + */ |
| 12 | +if (!defined('MEDIAWIKI')) die(); |
| 13 | + |
8 | 14 | global $smwgIP; |
9 | 15 | include_once($smwgIP . '/languages/SMW_Language.php'); |
10 | 16 | |
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageDe.php |
— | — | @@ -11,6 +11,11 @@ |
12 | 12 | * "printout statement" --> Ausgabeanweisung |
13 | 13 | */ |
14 | 14 | |
| 15 | +/** |
| 16 | + * Protect against register_globals vulnerabilities. |
| 17 | + * This line must be present before any global variable is referenced. |
| 18 | + */ |
| 19 | +if (!defined('MEDIAWIKI')) die(); |
15 | 20 | |
16 | 21 | global $smwgIP; |
17 | 22 | include_once($smwgIP . '/languages/SMW_Language.php'); |
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageZh_tw.php |
— | — | @@ -3,6 +3,12 @@ |
4 | 4 | * @author Markus Krötzsch 翻譯:張致信(Translation: Roc Michael Email:roc.no1@gmail.com) 2007-10-20 |
5 | 5 | */ |
6 | 6 | |
| 7 | +/** |
| 8 | + * Protect against register_globals vulnerabilities. |
| 9 | + * This line must be present before any global variable is referenced. |
| 10 | + */ |
| 11 | +if (!defined('MEDIAWIKI')) die(); |
| 12 | + |
7 | 13 | global $smwgIP; |
8 | 14 | include_once($smwgIP . '/languages/SMW_Language.php'); |
9 | 15 | |
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageArz.php |
— | — | @@ -3,6 +3,12 @@ |
4 | 4 | * @author Meno25 |
5 | 5 | */ |
6 | 6 | |
| 7 | +/** |
| 8 | + * Protect against register_globals vulnerabilities. |
| 9 | + * This line must be present before any global variable is referenced. |
| 10 | + */ |
| 11 | +if (!defined('MEDIAWIKI')) die(); |
| 12 | + |
7 | 13 | global $smwgIP; |
8 | 14 | include_once($smwgIP . '/languages/SMW_Language.php'); |
9 | 15 | |
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageHe.php |
— | — | @@ -3,6 +3,12 @@ |
4 | 4 | * @author Udi Oron אודי אורון |
5 | 5 | */ |
6 | 6 | |
| 7 | +/** |
| 8 | + * Protect against register_globals vulnerabilities. |
| 9 | + * This line must be present before any global variable is referenced. |
| 10 | + */ |
| 11 | +if (!defined('MEDIAWIKI')) die(); |
| 12 | + |
7 | 13 | global $smwgIP; |
8 | 14 | include_once($smwgIP . '/languages/SMW_Language.php'); |
9 | 15 | |
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageZh_cn.php |
— | — | @@ -3,6 +3,12 @@ |
4 | 4 | * @author Markus Krötzsch 翻译:张致信 本档系以电子字典译自繁体版,请自行修订(Translation: Roc Michael Email:roc.no1@gmail.com. This file is translated from Tradition Chinese by useing electronic dictionary. Please correct the file by yourself.) 2007-10-22 |
5 | 5 | */ |
6 | 6 | |
| 7 | +/** |
| 8 | + * Protect against register_globals vulnerabilities. |
| 9 | + * This line must be present before any global variable is referenced. |
| 10 | + */ |
| 11 | +if (!defined('MEDIAWIKI')) die(); |
| 12 | + |
7 | 13 | global $smwgIP; |
8 | 14 | include_once($smwgIP . '/languages/SMW_Language.php'); |
9 | 15 | |
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageAr.php |
— | — | @@ -4,6 +4,12 @@ |
5 | 5 | * @author Meno25 |
6 | 6 | */ |
7 | 7 | |
| 8 | +/** |
| 9 | + * Protect against register_globals vulnerabilities. |
| 10 | + * This line must be present before any global variable is referenced. |
| 11 | + */ |
| 12 | +if (!defined('MEDIAWIKI')) die(); |
| 13 | + |
8 | 14 | global $smwgIP; |
9 | 15 | include_once($smwgIP . '/languages/SMW_Language.php'); |
10 | 16 | |
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageEn.php |
— | — | @@ -3,6 +3,12 @@ |
4 | 4 | * @author Markus Krötzsch |
5 | 5 | */ |
6 | 6 | |
| 7 | +/** |
| 8 | + * Protect against register_globals vulnerabilities. |
| 9 | + * This line must be present before any global variable is referenced. |
| 10 | + */ |
| 11 | +if (!defined('MEDIAWIKI')) die(); |
| 12 | + |
7 | 13 | global $smwgIP; |
8 | 14 | include_once($smwgIP . '/languages/SMW_Language.php'); |
9 | 15 | |
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageEs.php |
— | — | @@ -3,6 +3,12 @@ |
4 | 4 | * @author Javier Calzada Prado, Carmen Jorge García-Reyes, Universidad Carlos III de Madrid, Jesús Espino García |
5 | 5 | */ |
6 | 6 | |
| 7 | +/** |
| 8 | + * Protect against register_globals vulnerabilities. |
| 9 | + * This line must be present before any global variable is referenced. |
| 10 | + */ |
| 11 | +if (!defined('MEDIAWIKI')) die(); |
| 12 | + |
7 | 13 | global $smwgIP; |
8 | 14 | include_once($smwgIP . '/languages/SMW_Language.php'); |
9 | 15 | |
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageFr.php |
— | — | @@ -3,6 +3,12 @@ |
4 | 4 | * @author Pierre Matringe |
5 | 5 | */ |
6 | 6 | |
| 7 | +/** |
| 8 | + * Protect against register_globals vulnerabilities. |
| 9 | + * This line must be present before any global variable is referenced. |
| 10 | + */ |
| 11 | +if (!defined('MEDIAWIKI')) die(); |
| 12 | + |
7 | 13 | global $smwgIP; |
8 | 14 | include_once($smwgIP . '/languages/SMW_Language.php'); |
9 | 15 | |
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageNl.php |
— | — | @@ -3,6 +3,12 @@ |
4 | 4 | * @author Siebrand Mazeland |
5 | 5 | */ |
6 | 6 | |
| 7 | +/** |
| 8 | + * Protect against register_globals vulnerabilities. |
| 9 | + * This line must be present before any global variable is referenced. |
| 10 | + */ |
| 11 | +if (!defined('MEDIAWIKI')) die(); |
| 12 | + |
7 | 13 | global $smwgIP; |
8 | 14 | include_once($smwgIP . '/languages/SMW_Language.php'); |
9 | 15 | |
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_LanguageKo.php |
— | — | @@ -6,6 +6,12 @@ |
7 | 7 | * @author Terry A. Hurlbut |
8 | 8 | */ |
9 | 9 | |
| 10 | +/** |
| 11 | + * Protect against register_globals vulnerabilities. |
| 12 | + * This line must be present before any global variable is referenced. |
| 13 | + */ |
| 14 | +if (!defined('MEDIAWIKI')) die(); |
| 15 | + |
10 | 16 | global $smwgIP; |
11 | 17 | include_once($smwgIP . '/languages/SMW_Language.php'); |
12 | 18 | |
Index: trunk/extensions/WhoIsWatching/SpecialWhoIsWatching.php |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | if (!defined('MEDIAWIKI')) { |
6 | 6 | echo <<<EOT |
7 | 7 | To install my extension, put the following line in LocalSettings.php: |
8 | | -require_once( "$IP/extensions/WhoIsWatching/SpecialWhoIsWatching.php" ); |
| 8 | +require_once( "\$IP/extensions/WhoIsWatching/SpecialWhoIsWatching.php" ); |
9 | 9 | EOT; |
10 | 10 | exit( 1 ); |
11 | 11 | } |
Index: trunk/extensions/SocialProfile/SocialProfile.php |
— | — | @@ -1,4 +1,9 @@ |
2 | 2 | <?php |
| 3 | +/** |
| 4 | + * Protect against register_globals vulnerabilities. |
| 5 | + * This line must be present before any global variable is referenced. |
| 6 | + */ |
| 7 | +if (!defined('MEDIAWIKI')) die(); |
3 | 8 | |
4 | 9 | $dir = dirname(__FILE__) . '/'; |
5 | 10 | |
Index: trunk/extensions/WhiteList/SpecialWhitelistEdit_body.php |
— | — | @@ -44,8 +44,6 @@ |
45 | 45 | return wfMsg($key); |
46 | 46 | } |
47 | 47 | |
48 | | -require_once("$IP/includes/SpecialPage.php"); |
49 | | - |
50 | 48 | class WhitelistEdit extends SpecialPage |
51 | 49 | { |
52 | 50 | function WhitelistEdit() { |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/cortado_iframe.php |
— | — | @@ -6,13 +6,16 @@ |
7 | 7 | */ |
8 | 8 | //load the http GETS: |
9 | 9 | |
| 10 | +// set the parent domain if provided |
| 11 | +// needed before error_out can be called |
| 12 | +$parent_domain = isset( $_GET['parent_domain'] ) ? wfEscapeJsString( $_GET['parent_domain'] ) : false; |
10 | 13 | |
11 | 14 | $error=''; |
12 | 15 | if(!function_exists('filter_input')){ |
13 | 16 | error_out('you version of php lacks <b>filter_input()</b> function</br>'); |
14 | 17 | } |
15 | 18 | //default to null media in not provided: |
16 | | -$media_url = filter_input(INPUT_GET, 'media_url', FILTER_SANITIZE_URL); |
| 19 | +$media_url = isset( $_GET['media_url'] ) ? htmlspecialchars( $_GET['media_url'] ) : false; |
17 | 20 | if( is_null($media_url) || $media_url===false || $media_url==''){ |
18 | 21 | error_out('not valid or missing media url'); |
19 | 22 | } |
— | — | @@ -25,7 +28,7 @@ |
26 | 29 | |
27 | 30 | //id (set to random if none provided) |
28 | 31 | //$id = (isset($_GET['id']))?$_GET['id']:'vid_'.rand('10000000'); |
29 | | -$id= filter_input(INPUT_GET, 'id', FILTER_SANITIZE_STRING); |
| 32 | +$id = isset($_GET['id']) ? htmlspecialchars( $_GET['id'] ) : false; |
30 | 33 | if( is_null($id) || $id===false){ |
31 | 34 | $id = 'vid_'.rand(0,10000000); |
32 | 35 | } |
— | — | @@ -48,18 +51,45 @@ |
49 | 52 | if(is_null($height) || $height===false) |
50 | 53 | $height = 20; |
51 | 54 | } |
52 | | -//set the parent domain if provided: |
53 | | -$parent_domain = filter_input(INPUT_GET, 'parent_domain', FILTER_SANITIZE_STRING); |
54 | 55 | |
55 | 56 | //everything good output page: |
56 | 57 | output_page(); |
57 | 58 | |
| 59 | +/** |
| 60 | + * JS escape function copied from MediaWiki's Xml::escapeJsString() |
| 61 | + */ |
| 62 | +function wfEscapeJsString( $string ) { |
| 63 | + // See ECMA 262 section 7.8.4 for string literal format |
| 64 | + $pairs = array( |
| 65 | + "\\" => "\\\\", |
| 66 | + "\"" => "\\\"", |
| 67 | + '\'' => '\\\'', |
| 68 | + "\n" => "\\n", |
| 69 | + "\r" => "\\r", |
| 70 | + |
| 71 | + # To avoid closing the element or CDATA section |
| 72 | + "<" => "\\x3c", |
| 73 | + ">" => "\\x3e", |
| 74 | + |
| 75 | + # To avoid any complaints about bad entity refs |
| 76 | + "&" => "\\x26", |
| 77 | + |
| 78 | + # Work around https://bugzilla.mozilla.org/show_bug.cgi?id=274152 |
| 79 | + # Encode certain Unicode formatting chars so affected |
| 80 | + # versions of Gecko don't misinterpret our strings; |
| 81 | + # this is a common problem with Farsi text. |
| 82 | + "\xe2\x80\x8c" => "\\u200c", // ZERO WIDTH NON-JOINER |
| 83 | + "\xe2\x80\x8d" => "\\u200d", // ZERO WIDTH JOINER |
| 84 | + ); |
| 85 | + return strtr( $string, $pairs ); |
| 86 | +} |
| 87 | + |
58 | 88 | function error_out($error=''){ |
59 | 89 | output_page($error); |
60 | 90 | exit(); |
61 | 91 | } |
62 | 92 | function output_page($error=''){ |
63 | | - global $id, $media_url, $audio, $video, $duration, $width, $height,$parent_domain; |
| 93 | + global $id, $media_url, $audio, $video, $duration, $width, $height, $parent_domain; |
64 | 94 | ?> |
65 | 95 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
66 | 96 | <html xmlns="http://www.w3.org/1999/xhtml"> |
— | — | @@ -68,7 +98,7 @@ |
69 | 99 | <title>cortado_embed</title> |
70 | 100 | <?if($parent_domain){?> |
71 | 101 | <script type="text/javascript"> |
72 | | - window.DOMAIN = '<?=$parent_domain?>'; |
| 102 | + window.DOMAIN = '<?=$parent_domain; ?>'; |
73 | 103 | </script> |
74 | 104 | <?}?> |
75 | 105 | <style type="text/css"> |
Index: trunk/extensions/SpamDiffTool/SpamDiffTool.php |
— | — | @@ -183,7 +183,7 @@ |
184 | 184 | $ntext = $de->mNewtext; |
185 | 185 | $ota = explode( "\n", $wgContLang->segmentForDiff( $otext ) ); |
186 | 186 | $nta = explode( "\n", $wgContLang->segmentForDiff( $ntext ) ); |
187 | | - $diffs =& new Diff( $ota, $nta ); |
| 187 | + $diffs = new Diff( $ota, $nta ); |
188 | 188 | |
189 | 189 | // iterate over the edits and get all of the changed text |
190 | 190 | foreach ($diffs->edits as $edit) { |
Index: trunk/extensions/SignDocument/SignDocument.php |
— | — | @@ -7,7 +7,7 @@ |
8 | 8 | if (!defined('MEDIAWIKI')) { |
9 | 9 | echo <<<EOT |
10 | 10 | To install my extension, put the following line in LocalSettings.php: |
11 | | -require_once( "$IP/extensions/SignDocument/SignDocument.php.php" ); |
| 11 | +require_once( "\$IP/extensions/SignDocument/SignDocument.php.php" ); |
12 | 12 | EOT; |
13 | 13 | exit( 1 ); |
14 | 14 | } |
Index: trunk/extensions/EditOwn/EditOwn.php |
— | — | @@ -18,7 +18,7 @@ |
19 | 19 | if (!defined('MEDIAWIKI')) { |
20 | 20 | echo <<<EOT |
21 | 21 | To install the EditOwn extension, put the following line in LocalSettings.php: |
22 | | -require_once( "$IP/extensions/EditOwn/EditOwn.php" ); |
| 22 | +require_once( "\$IP/extensions/EditOwn/EditOwn.php" ); |
23 | 23 | EOT; |
24 | 24 | exit(1); |
25 | 25 | } |
— | — | @@ -71,4 +71,4 @@ |
72 | 72 | return true; |
73 | 73 | } |
74 | 74 | return($result = $cache[$user->getName()][$title->getArticleId()] = false); |
75 | | -} |
\ No newline at end of file |
| 75 | +} |
Index: trunk/extensions/geo/geomaker.php |
— | — | @@ -12,7 +12,6 @@ |
13 | 13 | if ( $image == "" ) |
14 | 14 | { |
15 | 15 | print "<html><head></head><body><form method=post>" ; |
16 | | - print $_POST["image"] ; |
17 | 16 | print "Image location (URL) <input type=text name='image'></input>" ; |
18 | 17 | print "<input type=submit value='OK'/></form></html>" ; |
19 | 18 | exit ( 0 ) ; |
— | — | @@ -71,12 +70,11 @@ |
72 | 71 | |
73 | 72 | $coords = implode ( ";" , $coords ) ; |
74 | 73 | |
75 | | -print " |
76 | | -<a href='" . make_link ( $coords ) . "&'><image src='{$image}' ismap/></a> |
77 | | -" ; |
| 74 | +print "\n<a href=\"" . htmlspecialchars( make_link ( $coords ) ) . "&\">" . |
| 75 | + "<img src=\"" . htmlspecialchars( $image ) . "\" ismap/></a>\n"; |
78 | 76 | |
79 | | -print "<br /><a href='" .make_link ( $c2 ) . "'>Remove last coordinates</a>" ; |
80 | | -print " | <a href='" . make_link ( array() ) . "'>Reset</a>" ; |
| 77 | +print "<br /><a href=\"" .htmlspecialchars( make_link ( $c2 ) ) . "\">Remove last coordinates</a>" ; |
| 78 | +print " | <a href=\"" . htmlspecialchars( make_link ( array() ) ) . "\">Reset</a>" ; |
81 | 79 | |
82 | 80 | # Conversion form |
83 | 81 | |
— | — | @@ -108,19 +106,19 @@ |
109 | 107 | $coords = implode ( " " , $coords ) ; |
110 | 108 | |
111 | 109 | # For output |
112 | | - $p1 = $_POST['p1'] ; |
113 | | - $p2 = $_POST['p2'] ; |
114 | | - $np1 = $_POST['np1'] ; |
115 | | - $np2 = $_POST['np2'] ; |
| 110 | + $p1 = htmlspecialchars( $_POST['p1'] ); |
| 111 | + $p2 = htmlspecialchars( $_POST['p2'] ); |
| 112 | + $np1 = htmlspecialchars( $_POST['np1'] ); |
| 113 | + $np2 = htmlspecialchars( $_POST['np2'] ); |
116 | 114 | } |
117 | 115 | else $p1 = $p2 = $np1 = $np2 = "" ; |
118 | 116 | |
119 | 117 | print "<br />Coordinates so far:<br />\n" ; |
120 | 118 | print "<form method=post><textarea style='width:100%' rows=5 cols=40 name='ctext'>\n" ; |
121 | | -print str_replace ( ";" , " " , $coords ) ; |
| 119 | +print htmlspecialchars( str_replace ( ";" , " " , $coords ) ); |
122 | 120 | print "</textarea>\n" ; |
123 | | -print "Conversion : Point <input type='text' name='p1'/ value='{$p1}'> matches coordinates <input type='text' name='np1' value='{$np1}'/><br />" ; |
124 | | -print "and point <input type='text' name='p2' value='{$p2}'/> matches coordinates <input type='text' name='np2' value='{$np2}'/>" ; |
| 121 | +print "Conversion : Point <input type='text' name='p1'/ value=\"{$p1}\"> matches coordinates <input type='text' name='np1' value=\"{$np1}\"/><br />" ; |
| 122 | +print "and point <input type='text' name='p2' value=\"{$p2}\"/> matches coordinates <input type='text' name='np2' value=\"{$np2}\"/>" ; |
125 | 123 | print " <input type='submit' name='convert' value='Convert'/>" ; |
126 | 124 | print "</form>" ; |
127 | 125 | |
Index: trunk/extensions/SpamRegex/SpamRegex.php |
— | — | @@ -20,10 +20,16 @@ |
21 | 21 | } |
22 | 22 | } |
23 | 23 | |
| 24 | +/** |
| 25 | + * Protect against register_globals vulnerabilities. |
| 26 | + * This line must be present before any global variable is referenced. |
| 27 | + */ |
| 28 | +if (!defined('MEDIAWIKI')) die(); |
| 29 | + |
24 | 30 | $dir = dirname(__FILE__) . '/'; |
25 | 31 | $wgExtensionMessagesFiles['Spamregex'] = $dir . 'SpamRegex.i18n.php'; |
26 | 32 | |
27 | 33 | require_once ($IP.SPAMREGEX_PATH."extensions/SpamRegex/SpecialSpamRegex.php"); |
28 | 34 | //will need more, maybe Core? |
29 | 35 | require_once ($IP.SPAMREGEX_PATH."extensions/SpamRegex/SpamRegexCore.php"); |
30 | | -require_once ($IP.SPAMREGEX_PATH."extensions/SimplifiedRegex/SimplifiedRegex.php"); |
\ No newline at end of file |
| 36 | +require_once ($IP.SPAMREGEX_PATH."extensions/SimplifiedRegex/SimplifiedRegex.php"); |
Index: trunk/extensions/TidyTab/Tidy.php |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | wfLoadExtensionMessages( 'tidy' ); |
31 | 31 | |
32 | 32 | $wgHooks['SkinTemplateContentActions'][] = array( &$this, 'tidyHook' ); |
33 | | - $wgHooks['UnknownAction'][] = array( &$this, 'tidyAction' ); |
| 33 | + $wgHooks['UnknownAction'][] = array( &$this, 'action' ); |
34 | 34 | } |
35 | 35 | |
36 | 36 | public function tidyHook( array &$content_actions ) { |
— | — | @@ -65,7 +65,7 @@ |
66 | 66 | ); |
67 | 67 | } |
68 | 68 | |
69 | | - public static function tidyAction( $action, Article &$article ) { |
| 69 | + public static function action( $action, Article &$article ) { |
70 | 70 | global $wgUseTidy; |
71 | 71 | |
72 | 72 | if ( $action === 'tidy' || $action === 'untidy' ) |
Index: trunk/extensions/SemanticForms/includes/SF_Settings.php |
— | — | @@ -1,4 +1,9 @@ |
2 | 2 | <?php |
| 3 | +/** |
| 4 | + * Protect against register_globals vulnerabilities. |
| 5 | + * This line must be present before any global variable is referenced. |
| 6 | + */ |
| 7 | +if (!defined('MEDIAWIKI')) die(); |
3 | 8 | |
4 | 9 | ### |
5 | 10 | # This is the path to your installation of Semantic Forms as |
Index: trunk/extensions/SemanticForms/includes/SF_GlobalFunctions.php |
— | — | @@ -7,6 +7,12 @@ |
8 | 8 | * @author Louis Gerbarg |
9 | 9 | */ |
10 | 10 | |
| 11 | +/** |
| 12 | + * Protect against register_globals vulnerabilities. |
| 13 | + * This line must be present before any global variable is referenced. |
| 14 | + */ |
| 15 | +if ( !defined( 'MEDIAWIKI' ) ) die(); |
| 16 | + |
11 | 17 | define('SF_VERSION','1.2.3'); |
12 | 18 | |
13 | 19 | // constants for special properties |
Index: trunk/extensions/SemanticForms/includes/SF_AutocompleteAPI.php |
— | — | @@ -6,6 +6,12 @@ |
7 | 7 | * @author Yaron Koren |
8 | 8 | */ |
9 | 9 | |
| 10 | +/** |
| 11 | + * Protect against register_globals vulnerabilities. |
| 12 | + * This line must be present before any global variable is referenced. |
| 13 | + */ |
| 14 | +if (!defined('MEDIAWIKI')) die(); |
| 15 | + |
10 | 16 | require_once ("$IP/includes/api/ApiBase.php"); |
11 | 17 | |
12 | 18 | global $wgAPIModules; |
Index: trunk/extensions/SemanticForms/specials/SF_CreateProperty.php |
— | — | @@ -6,9 +6,14 @@ |
7 | 7 | * @author Yaron Koren |
8 | 8 | */ |
9 | 9 | |
| 10 | +/** |
| 11 | + * Protect against register_globals vulnerabilities. |
| 12 | + * This line must be present before any global variable is referenced. |
| 13 | + */ |
| 14 | +if (!defined('MEDIAWIKI')) die(); |
| 15 | + |
10 | 16 | include_once $sfgIP . "/includes/SF_TemplateField.inc"; |
11 | 17 | |
12 | | -if (!defined('MEDIAWIKI')) die(); |
13 | 18 | |
14 | 19 | global $IP; |
15 | 20 | require_once( "$IP/includes/SpecialPage.php" ); |
Index: trunk/extensions/SemanticForms/specials/SF_CreateTemplate.php |
— | — | @@ -6,9 +6,14 @@ |
7 | 7 | * @author Yaron Koren |
8 | 8 | */ |
9 | 9 | |
| 10 | +/** |
| 11 | + * Protect against register_globals vulnerabilities. |
| 12 | + * This line must be present before any global variable is referenced. |
| 13 | + */ |
| 14 | +if (!defined('MEDIAWIKI')) die(); |
| 15 | + |
10 | 16 | include_once $sfgIP . "/includes/SF_TemplateField.inc"; |
11 | 17 | |
12 | | -if (!defined('MEDIAWIKI')) die(); |
13 | 18 | |
14 | 19 | global $IP; |
15 | 20 | require_once( "$IP/includes/SpecialPage.php" ); |
Index: trunk/extensions/SemanticForms/specials/SF_EditData.php |
— | — | @@ -4,10 +4,16 @@ |
5 | 5 | * |
6 | 6 | * @author Yaron Koren |
7 | 7 | */ |
8 | | -require_once( $sfgIP . "/includes/SF_FormPrinter.inc" ); |
9 | 8 | |
| 9 | +/** |
| 10 | + * Protect against register_globals vulnerabilities. |
| 11 | + * This line must be present before any global variable is referenced. |
| 12 | + */ |
10 | 13 | if (!defined('MEDIAWIKI')) die(); |
11 | 14 | |
| 15 | +require_once( $sfgIP . "/includes/SF_FormPrinter.inc" ); |
| 16 | + |
| 17 | + |
12 | 18 | global $IP; |
13 | 19 | require_once( "$IP/includes/SpecialPage.php" ); |
14 | 20 | |