Index: trunk/phase3/tests/phpunit/includes/TitlePermissionTest.php |
— | — | @@ -28,14 +28,14 @@ |
29 | 29 | $this->title = Title::makeTitle( NS_MAIN, "Main Page" ); |
30 | 30 | if ( !isset( $this->userUser ) || !( $this->userUser instanceOf User ) ) { |
31 | 31 | $this->userUser = User::newFromName( $this->userName ); |
32 | | - |
| 32 | + |
33 | 33 | if ( !$this->userUser->getID() ) { |
34 | 34 | $this->userUser = User::createNew( $this->userName, array( |
35 | 35 | "email" => "test@example.com", |
36 | 36 | "real_name" => "Test User" ) ); |
37 | 37 | $this->userUser->load(); |
38 | 38 | } |
39 | | - |
| 39 | + |
40 | 40 | $this->altUser = User::newFromName( $this->altUserName ); |
41 | 41 | if ( !$this->altUser->getID() ) { |
42 | 42 | $this->altUser = User::createNew( $this->altUserName, array( |
— | — | @@ -334,7 +334,7 @@ |
335 | 335 | $prefix = $wgContLang->getFormattedNsText( NS_PROJECT ); |
336 | 336 | |
337 | 337 | $this->setTitle( NS_SPECIAL ); |
338 | | - |
| 338 | + |
339 | 339 | $this->assertEquals( array( array( 'badaccess-group0' ), array( 'ns-specialprotected' ) ), |
340 | 340 | $this->title->getUserPermissionsErrors( 'bogus', $this->user ) ); |
341 | 341 | $this->assertEquals( array( array( 'badaccess-group0' ) ), |
Index: trunk/phase3/tests/phpunit/includes/api/ApiSetup.php |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | $data[0] = $module->getResultData(); |
29 | 29 | $data[1] = $req; |
30 | 30 | $data[2] = $_SESSION; |
31 | | - |
| 31 | + |
32 | 32 | if( $appendModule ) $data[3] = $module; |
33 | 33 | |
34 | 34 | return $data; |
— | — | @@ -41,7 +41,7 @@ |
42 | 42 | |
43 | 43 | $GLOBALS['wgUser'] = $this->sysopUser->user; |
44 | 44 | } |
45 | | - |
| 45 | + |
46 | 46 | function doLogin() { |
47 | 47 | $data = $this->doApiRequest( array( |
48 | 48 | 'action' => 'login', |
— | — | @@ -55,10 +55,10 @@ |
56 | 56 | "lgtoken" => $token, |
57 | 57 | "lgname" => $this->sysopUser->userName, |
58 | 58 | "lgpassword" => $this->sysopUser->password ), $data ); |
59 | | - |
| 59 | + |
60 | 60 | return $data; |
61 | 61 | } |
62 | | - |
| 62 | + |
63 | 63 | function getTokenList( $user ) { |
64 | 64 | $GLOBALS['wgUser'] = $user->user; |
65 | 65 | $data = $this->doApiRequest( array( |
— | — | @@ -68,7 +68,7 @@ |
69 | 69 | 'prop' => 'info' ) ); |
70 | 70 | return $data; |
71 | 71 | } |
72 | | - |
| 72 | + |
73 | 73 | } |
74 | 74 | |
75 | 75 | class UserWrapper { |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -10,9 +10,9 @@ |
11 | 11 | * |
12 | 12 | * This class is used to prepare the final rendering. A skin is then |
13 | 13 | * applied to the output parameters (links, javascript, html, categories ...). |
14 | | - * |
| 14 | + * |
15 | 15 | * Another class (fixme) handles sending the whole page to the client. |
16 | | - * |
| 16 | + * |
17 | 17 | * Some comments comes from a pairing session between Zak Greant and Ashar Voultoiz |
18 | 18 | * in November 2010. |
19 | 19 | * |
— | — | @@ -1161,7 +1161,7 @@ |
1162 | 1162 | /** |
1163 | 1163 | * Return whether user JavaScript is allowed for this page |
1164 | 1164 | * @deprecated since 1.18 Load modules with ResourceLoader, and origin and |
1165 | | - * trustworthiness is identified and enforced automagically. |
| 1165 | + * trustworthiness is identified and enforced automagically. |
1166 | 1166 | * @return Boolean |
1167 | 1167 | */ |
1168 | 1168 | public function isUserJsAllowed() { |
— | — | @@ -1672,11 +1672,11 @@ |
1673 | 1673 | } |
1674 | 1674 | |
1675 | 1675 | /** |
1676 | | - * Set a flag which will cause an X-Frame-Options header appropriate for |
1677 | | - * edit pages to be sent. The header value is controlled by |
| 1676 | + * Set a flag which will cause an X-Frame-Options header appropriate for |
| 1677 | + * edit pages to be sent. The header value is controlled by |
1678 | 1678 | * $wgEditPageFrameOptions. |
1679 | 1679 | * |
1680 | | - * This is the default for special pages. If you display a CSRF-protected |
| 1680 | + * This is the default for special pages. If you display a CSRF-protected |
1681 | 1681 | * form on an ordinary view page, then you need to call this function. |
1682 | 1682 | */ |
1683 | 1683 | public function preventClickjacking( $enable = true ) { |
— | — | @@ -1693,8 +1693,8 @@ |
1694 | 1694 | } |
1695 | 1695 | |
1696 | 1696 | /** |
1697 | | - * Get the X-Frame-Options header value (without the name part), or false |
1698 | | - * if there isn't one. This is used by Skin to determine whether to enable |
| 1697 | + * Get the X-Frame-Options header value (without the name part), or false |
| 1698 | + * if there isn't one. This is used by Skin to determine whether to enable |
1699 | 1699 | * JavaScript frame-breaking, for clients that don't support X-Frame-Options. |
1700 | 1700 | */ |
1701 | 1701 | public function getFrameOptions() { |
— | — | @@ -2381,7 +2381,7 @@ |
2382 | 2382 | $this->mResourceLoader = new ResourceLoader(); |
2383 | 2383 | } |
2384 | 2384 | return $this->mResourceLoader; |
2385 | | - } |
| 2385 | + } |
2386 | 2386 | |
2387 | 2387 | /** |
2388 | 2388 | * TODO: Document |
— | — | @@ -2460,7 +2460,7 @@ |
2461 | 2461 | if ( ( $group === 'user' || $group === 'private' ) && $this->getUser()->isLoggedIn() ) { |
2462 | 2462 | $query['user'] = $this->getUser()->getName(); |
2463 | 2463 | } |
2464 | | - |
| 2464 | + |
2465 | 2465 | // Create a fake request based on the one we are about to make so modules return |
2466 | 2466 | // correct timestamp and emptiness data |
2467 | 2467 | $context = new ResourceLoaderContext( $resourceLoader, new FauxRequest( $query ) ); |
— | — | @@ -2474,9 +2474,9 @@ |
2475 | 2475 | if ( $modules === array() ) { |
2476 | 2476 | continue; |
2477 | 2477 | } |
2478 | | - |
| 2478 | + |
2479 | 2479 | $query['modules'] = implode( '|', array_keys( $modules ) ); |
2480 | | - |
| 2480 | + |
2481 | 2481 | // Support inlining of private modules if configured as such |
2482 | 2482 | if ( $group === 'private' && $wgResourceLoaderInlinePrivateModules ) { |
2483 | 2483 | if ( $only == ResourceLoaderModule::TYPE_STYLES ) { |
— | — | @@ -2545,14 +2545,14 @@ |
2546 | 2546 | function getHeadScripts( Skin $sk ) { |
2547 | 2547 | // Startup - this will immediately load jquery and mediawiki modules |
2548 | 2548 | $scripts = $this->makeResourceLoaderLink( $sk, 'startup', ResourceLoaderModule::TYPE_SCRIPTS, true ); |
2549 | | - |
| 2549 | + |
2550 | 2550 | // Load config before anything else |
2551 | 2551 | $scripts .= Html::inlineScript( |
2552 | 2552 | ResourceLoader::makeLoaderConditionalScript( |
2553 | 2553 | ResourceLoader::makeConfigSetScript( $this->getJSVars() ) |
2554 | 2554 | ) |
2555 | 2555 | ); |
2556 | | - |
| 2556 | + |
2557 | 2557 | // Script and Messages "only" requests marked for top inclusion |
2558 | 2558 | // Messages should go first |
2559 | 2559 | $scripts .= $this->makeResourceLoaderLink( $sk, $this->getModuleMessages( true, 'top' ), ResourceLoaderModule::TYPE_MESSAGES ); |
— | — | @@ -2572,14 +2572,14 @@ |
2573 | 2573 | |
2574 | 2574 | return $scripts; |
2575 | 2575 | } |
2576 | | - |
| 2576 | + |
2577 | 2577 | /** |
2578 | 2578 | * JS stuff to put at the bottom of the <body>: modules marked with position 'bottom', |
2579 | 2579 | * legacy scripts ($this->mScripts), user preferences, site JS and user JS |
2580 | 2580 | */ |
2581 | 2581 | function getBottomScripts( Skin $sk ) { |
2582 | 2582 | global $wgUseSiteJs, $wgAllowUserJs; |
2583 | | - |
| 2583 | + |
2584 | 2584 | // Script and Messages "only" requests marked for bottom inclusion |
2585 | 2585 | // Messages should go first |
2586 | 2586 | $scripts = $this->makeResourceLoaderLink( $sk, $this->getModuleMessages( true, 'bottom' ), ResourceLoaderModule::TYPE_MESSAGES ); |
— | — | @@ -2597,7 +2597,7 @@ |
2598 | 2598 | ) |
2599 | 2599 | ); |
2600 | 2600 | } |
2601 | | - |
| 2601 | + |
2602 | 2602 | // Legacy Scripts |
2603 | 2603 | $scripts .= "\n" . $this->mScripts; |
2604 | 2604 | |
— | — | @@ -2624,13 +2624,13 @@ |
2625 | 2625 | } |
2626 | 2626 | } |
2627 | 2627 | $scripts .= $this->makeResourceLoaderLink( $sk, $userScripts, ResourceLoaderModule::TYPE_SCRIPTS ); |
2628 | | - |
| 2628 | + |
2629 | 2629 | return $scripts; |
2630 | 2630 | } |
2631 | 2631 | |
2632 | 2632 | /** |
2633 | 2633 | * Get an array containing global JS variables |
2634 | | - * |
| 2634 | + * |
2635 | 2635 | * Do not add things here which can be evaluated in |
2636 | 2636 | * ResourceLoaderStartupScript - in other words, without state. |
2637 | 2637 | * You will only be adding bloat to the page and causing page caches to |
— | — | @@ -2672,10 +2672,10 @@ |
2673 | 2673 | if ( $wgUseAjax && $wgEnableMWSuggest && !$this->getUser()->getOption( 'disablesuggest', false ) ) { |
2674 | 2674 | $vars['wgSearchNamespaces'] = SearchEngine::userNamespaces( $this->getUser() ); |
2675 | 2675 | } |
2676 | | - |
| 2676 | + |
2677 | 2677 | // Allow extensions to add their custom variables to the global JS variables |
2678 | 2678 | wfRunHooks( 'MakeGlobalVariablesScript', array( &$vars ) ); |
2679 | | - |
| 2679 | + |
2680 | 2680 | return $vars; |
2681 | 2681 | } |
2682 | 2682 | |
— | — | @@ -3007,7 +3007,7 @@ |
3008 | 3008 | // Add marker tag to mark the place where the client-side loader should inject dynamic styles |
3009 | 3009 | // We use a <meta> tag with a made-up name for this because that's valid HTML |
3010 | 3010 | $ret .= Html::element( 'meta', array( 'name' => 'ResourceLoaderDynamicStyles', 'content' => '' ) ) . "\n"; |
3011 | | - |
| 3011 | + |
3012 | 3012 | // Add site, private and user styles |
3013 | 3013 | // 'private' at present only contains user.options, so put that before 'user' |
3014 | 3014 | // Any future private modules will likely have a similar user-specific character |