r60707 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60706‎ | r60707 | r60708 >
Date:03:42, 6 January 2010
Author:mah
Status:ok
Tags:
Comment:
Random eol whitespace found while treking through files.
Removing unused call to $wgContLang->getFormattedNsText() from addNewUserLogEntry()
Modified paths:
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)
  • /trunk/phase3/includes/WebRequest.php (modified) (history)
  • /trunk/phase3/includes/db/LBFactory.php (modified) (history)
  • /trunk/phase3/maintenance/Maintenance.php (modified) (history)
  • /trunk/phase3/maintenance/install-utils.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -216,7 +216,7 @@
217217 $mBlockreason, $mBlock, $mEffectiveGroups, $mBlockedGlobally,
218218 $mLocked, $mHideName, $mOptions;
219219 //@}
220 -
 220+
221221 static $idCacheByName = array();
222222
223223 /**
@@ -636,12 +636,12 @@
637637 */
638638 function getPasswordValidity( $password ) {
639639 global $wgMinimalPasswordLength, $wgContLang;
640 -
 640+
641641 $result = false; //init $result to false for the internal checks
642 -
 642+
643643 if( !wfRunHooks( 'isValidPassword', array( $password, &$result, $this ) ) )
644644 return $result;
645 -
 645+
646646 if ( $result === false ) {
647647 if( strlen( $password ) < $wgMinimalPasswordLength ) {
648648 return 'passwordtooshort';
@@ -1055,7 +1055,7 @@
10561056 $defOpt['searchNs'.$nsnum] = !empty( $wgNamespacesToBeSearchedDefault[$nsnum] );
10571057 }
10581058 $defOpt['skin'] = $wgDefaultSkin;
1059 -
 1059+
10601060 return $defOpt;
10611061 }
10621062
@@ -1392,9 +1392,9 @@
13931393 $blocked = false;
13941394 wfDebug( __METHOD__ . ": self-talk page, ignoring any blocks\n" );
13951395 }
1396 -
 1396+
13971397 wfRunHooks( 'UserIsBlockedFrom', array( $this, $title, &$blocked, &$allowUsertalk ) );
1398 -
 1398+
13991399 wfProfileOut( __METHOD__ );
14001400 return $blocked;
14011401 }
@@ -2525,9 +2525,9 @@
25262526 'user_id' => $this->mId
25272527 ), __METHOD__
25282528 );
2529 -
 2529+
25302530 $this->saveOptions();
2531 -
 2531+
25322532 wfRunHooks( 'UserSaveSettings', array( $this ) );
25332533 $this->clearSharedCache();
25342534 $this->getUserPage()->invalidateCache();
@@ -2626,7 +2626,7 @@
26272627
26282628 // Clear instance cache other than user table data, which is already accurate
26292629 $this->clearInstanceCache();
2630 -
 2630+
26312631 $this->saveOptions();
26322632 }
26332633
@@ -3563,11 +3563,11 @@
35643564 * @param $byEmail Boolean: account made by email?
35653565 */
35663566 public function addNewUserLogEntry( $byEmail = false ) {
3567 - global $wgUser, $wgContLang, $wgNewUserLog;
 3567+ global $wgUser, $wgNewUserLog;
35683568 if( empty( $wgNewUserLog ) ) {
35693569 return true; // disabled
35703570 }
3571 - $talk = $wgContLang->getFormattedNsText( NS_TALK );
 3571+
35723572 if( $this->getName() == $wgUser->getName() ) {
35733573 $action = 'create';
35743574 $message = '';
@@ -3650,11 +3650,11 @@
36513651
36523652 $this->loadOptions();
36533653 $dbw = wfGetDB( DB_MASTER );
3654 -
 3654+
36553655 $insert_rows = array();
3656 -
 3656+
36573657 $saveOptions = $this->mOptions;
3658 -
 3658+
36593659 // Allow hooks to abort, for instance to save to a global profile.
36603660 // Reset options to default state before saving.
36613661 if( !wfRunHooks( 'UserSaveOptions', array( $this, &$saveOptions ) ) )
Index: trunk/phase3/includes/db/LBFactory.php
@@ -25,7 +25,7 @@
2626
2727 /**
2828 * Shut down, close connections and destroy the cached instance.
29 - *
 29+ *
3030 */
3131 static function destroyInstance() {
3232 if ( self::$instance ) {
@@ -41,7 +41,7 @@
4242 abstract function __construct( $conf );
4343
4444 /**
45 - * Create a new load balancer object. The resulting object will be untracked,
 45+ * Create a new load balancer object. The resulting object will be untracked,
4646 * not chronology-protected, and the caller is responsible for cleaning it up.
4747 *
4848 * @param string $wiki Wiki ID, or false for the current wiki
@@ -58,8 +58,8 @@
5959 abstract function getMainLB( $wiki = false );
6060
6161 /*
62 - * Create a new load balancer for external storage. The resulting object will be
63 - * untracked, not chronology-protected, and the caller is responsible for
 62+ * Create a new load balancer for external storage. The resulting object will be
 63+ * untracked, not chronology-protected, and the caller is responsible for
6464 * cleaning it up.
6565 *
6666 * @param string $cluster External storage cluster, or false for core
@@ -142,8 +142,8 @@
143143 }
144144
145145 return new LoadBalancer( array(
146 - 'servers' => $servers,
147 - 'masterWaitTimeout' => $wgMasterWaitTimeout
 146+ 'servers' => $servers,
 147+ 'masterWaitTimeout' => $wgMasterWaitTimeout
148148 ));
149149 }
150150
@@ -162,7 +162,7 @@
163163 throw new MWException( __METHOD__.": Unknown cluster \"$cluster\"" );
164164 }
165165 return new LoadBalancer( array(
166 - 'servers' => $wgExternalServers[$cluster]
 166+ 'servers' => $wgExternalServers[$cluster]
167167 ));
168168 }
169169
Index: trunk/phase3/includes/WebRequest.php
@@ -39,7 +39,7 @@
4040 * not create a second WebRequest object; make a FauxRequest object if
4141 * you want to pass arbitrary data to some function in place of the web
4242 * input.
43 - *
 43+ *
4444 * @ingroup HTTP
4545 */
4646 class WebRequest {
@@ -66,11 +66,13 @@
6767 */
6868 public function interpolateTitle() {
6969 global $wgUsePathInfo;
 70+
7071 if ( $wgUsePathInfo ) {
7172 // PATH_INFO is mangled due to http://bugs.php.net/bug.php?id=31892
7273 // And also by Apache 2.x, double slashes are converted to single slashes.
7374 // So we will use REQUEST_URI if possible.
7475 $matches = array();
 76+
7577 if ( !empty( $_SERVER['REQUEST_URI'] ) ) {
7678 // Slurp out the path portion to examine...
7779 $url = $_SERVER['REQUEST_URI'];
@@ -180,7 +182,7 @@
181183 */
182184 private function checkMagicQuotes() {
183185 $mustFixQuotes = function_exists( 'get_magic_quotes_gpc' )
184 - && get_magic_quotes_gpc();
 186+ && get_magic_quotes_gpc();
185187 if( $mustFixQuotes ) {
186188 $this->fix_magic_quotes( $_COOKIE );
187189 $this->fix_magic_quotes( $_ENV );
@@ -260,7 +262,7 @@
261263 return (string)$val;
262264 }
263265 }
264 -
 266+
265267 /**
266268 * Set an aribtrary value into our get/post data.
267269 * @param $key string Key name to use
@@ -653,7 +655,7 @@
654656 }
655657 }
656658 }
657 -
 659+
658660 /*
659661 * Get data from $_SESSION
660662 * @param $key String Name of key in $_SESSION
@@ -664,7 +666,7 @@
665667 return null;
666668 return $_SESSION[$key];
667669 }
668 -
 670+
669671 /**
670672 * Set session data
671673 * @param $key String Name of key in $_SESSION
@@ -675,20 +677,20 @@
676678 }
677679
678680 /**
679 - * Returns true if the PATH_INFO ends with an extension other than a script
 681+ * Returns true if the PATH_INFO ends with an extension other than a script
680682 * extension. This could confuse IE for scripts that send arbitrary data which
681683 * is not HTML but may be detected as such.
682684 *
683 - * Various past attempts to use the URL to make this check have generally
684 - * run up against the fact that CGI does not provide a standard method to
685 - * determine the URL. PATH_INFO may be mangled (e.g. if cgi.fix_pathinfo=0),
686 - * but only by prefixing it with the script name and maybe some other stuff,
687 - * the extension is not mangled. So this should be a reasonably portable
 685+ * Various past attempts to use the URL to make this check have generally
 686+ * run up against the fact that CGI does not provide a standard method to
 687+ * determine the URL. PATH_INFO may be mangled (e.g. if cgi.fix_pathinfo=0),
 688+ * but only by prefixing it with the script name and maybe some other stuff,
 689+ * the extension is not mangled. So this should be a reasonably portable
688690 * way to perform this security check.
689691 */
690692 public function isPathInfoBad() {
691693 global $wgScriptExtension;
692 -
 694+
693695 if ( !isset( $_SERVER['PATH_INFO'] ) ) {
694696 return false;
695697 }
Index: trunk/phase3/includes/DefaultSettings.php
@@ -471,7 +471,7 @@
472472 * Useful if you want to use a shared repository by default
473473 * without disabling local uploads (use $wgEnableUploads = false for that)
474474 * e.g. $wgUploadNavigationUrl = 'http://commons.wikimedia.org/wiki/Special:Upload';
475 - *
 475+ *
476476 * This also affects images inline images that do not exist. In that case the URL will get
477477 * (?|&)wpDestFile=<filename> appended to it as appropriate.
478478 */
@@ -715,8 +715,8 @@
716716 */
717717 $wgLBFactoryConf = array( 'class' => 'LBFactory_Simple' );
718718
719 -/**
720 - * Unique identifier if you're paranoid and don't want $wgDBname as part of
 719+/**
 720+ * Unique identifier if you're paranoid and don't want $wgDBname as part of
721721 * wfWikiId(). See bug 21086
722722 */
723723 $wgWikiId = false;
@@ -866,14 +866,14 @@
867867 $wgOutputEncoding = 'UTF-8';
868868 $wgEditEncoding = '';
869869
870 -/**
871 - * Set this to true to clean up archaic Unicode sequences in Arabic and
 870+/**
 871+ * Set this to true to clean up archaic Unicode sequences in Arabic and
872872 * Malayalam text. Currently only works if $wgLanguageCode is set to Arabic
873873 * or Malayalam.
874874 *
875 - * Enabling this is generally a good idea for new wikis, since it fixes a few
876 - * technical problems to do with editing these languages. However, if it's
877 - * enabled on an existing wiki, pages which contain the problematic characters
 875+ * Enabling this is generally a good idea for new wikis, since it fixes a few
 876+ * technical problems to do with editing these languages. However, if it's
 877+ * enabled on an existing wiki, pages which contain the problematic characters
878878 * in their page titles may become inaccessible. Running maintenance/cleanupTitles.php
879879 * after enabling it may fix this.
880880 */
@@ -936,7 +936,7 @@
937937 $wgHtml5Version = null;
938938
939939 /**
940 - * Enabled RDFa attributes for use in wikitext.
 940+ * Enabled RDFa attributes for use in wikitext.
941941 * NOTE: Interaction with HTML5 is somewhat underspecified.
942942 */
943943 $wgAllowRdfaAttributes = true;
@@ -1040,17 +1040,17 @@
10411041 * Like $wgArticlePath, but on multi-variant wikis, this provides a
10421042 * path format that describes which parts of the URL contain the
10431043 * language variant. For Example:
1044 - *
 1044+ *
10451045 * $wgLanguageCode = 'sr';
10461046 * $wgVariantArticlePath = '/$2/$1';
10471047 * $wgArticlePath = '/wiki/$1';
1048 - *
 1048+ *
10491049 * A link to /wiki/ would be redirected to /sr/Главна_страна
10501050 *
10511051 * It is important that $wgArticlePath not overlap with possible values
10521052 * of $wgVariantArticlePath.
10531053 */
1054 -$wgVariantArticlePath = false;///< defaults to false
 1054+$wgVariantArticlePath = false;///< defaults to false
10551055
10561056 /**
10571057 * Show a bar of language selection links in the user login and user
@@ -1932,8 +1932,8 @@
19331933 $wgUseTeX = false;
19341934 /** Location of the texvc binary */
19351935 $wgTexvc = './math/texvc';
1936 -/**
1937 - * Texvc background color
 1936+/**
 1937+ * Texvc background color
19381938 * use LaTeX color format as used in \special function
19391939 * for transparent background use value 'Transparent' for alpha transparency or
19401940 * 'transparent' for binary transparency.
Index: trunk/phase3/maintenance/Maintenance.php
@@ -373,7 +373,7 @@
374374 $this->maybeHelp();
375375 $this->validateParamsAndArgs();
376376 }
377 -
 377+
378378 /**
379379 * Normally we disable the memory_limit when running admin scripts.
380380 * Some scripts may wish to actually set a limit, however, to avoid
Index: trunk/phase3/maintenance/install-utils.inc
@@ -23,7 +23,7 @@
2424 "to continue installation. ABORTING.\n";
2525 die( -1 );
2626 }
27 -
 27+
2828 // Test for PHP bug which breaks PHP 5.0.x on 64-bit...
2929 // As of 1.8 this breaks lots of common operations instead
3030 // of just some rare ones like export.
@@ -33,7 +33,7 @@
3434 "or higher. ABORTING. (http://bugs.php.net/bug.php?id=34879 for details)\n";
3535 die( -1 );
3636 }
37 -
 37+
3838 $test = new PhpXmlBugTester();
3939 if( !$test->ok ) {
4040 echo "Your system has a combination of PHP and libxml2 versions which is buggy\n" .
@@ -42,8 +42,8 @@
4343 "ABORTING (http://bugs.php.net/bug.php?id=45996 for details).\n";
4444 die( -1 );
4545 }
46 -
4746
 47+
4848 global $wgCommandLineMode;
4949 $wgCommandLineMode = true;
5050 umask( 000 );
@@ -61,7 +61,7 @@
6262 public function __construct() {
6363 $charData = '<b>c</b>';
6464 $xml = '<a>' . htmlspecialchars( $charData ) . '</a>';
65 -
 65+
6666 $parser = xml_parser_create();
6767 xml_set_character_data_handler( $parser, array( $this, 'chardata' ) );
6868 $parsedOk = xml_parse($parser, $xml, true);
@@ -121,7 +121,7 @@
122122 $command = "read -er -p $encPrompt && echo \"\$REPLY\"";
123123 $encCommand = wfEscapeShellArg( $command );
124124 $line = wfShellExec( "$bash -c $encCommand", $retval );
125 -
 125+
126126 if( $retval == 0 ) {
127127 return $line;
128128 } elseif( $retval == 127 ) {
@@ -133,7 +133,7 @@
134134 return false;
135135 }
136136 }
137 -
 137+
138138 // Fallback... we'll have no editing controls, EWWW
139139 if ( feof( STDIN ) ) {
140140 return false;

Status & tagging log