r97445 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97444‎ | r97445 | r97446 >
Date:23:21, 18 September 2011
Author:krinkle
Status:ok
Tags:
Comment:
Minor whitespace fixes in GlobalFunctions.php
* And some adjustments to documentation (sentence ended with "use the wikis", adjusted to "use the wikis' content language")
[svnblameutil:] r97136,r88447,r86368,r81597,r72134,r2969
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -164,7 +164,7 @@
165165 * array( array( 'x' ) ),
166166 * array( array( 'x', '2' ) ),
167167 * array( array( 'x' ) ),
168 - * array( array( 'y') )
 168+ * array( array( 'y' ) )
169169 * );
170170 * returns:
171171 * array(
@@ -981,9 +981,10 @@
982982 * a valid code create a language for that language, if
983983 * it is a string but not a valid code then make a basic
984984 * language object
985 - * - a boolean: if it's false then use the current users
986 - * language (as a fallback for the old parameter
987 - * functionality), or if it is true then use the wikis
 985+ * - a boolean: if it's false then use the global object for
 986+ * the current user's language (as a fallback for the old parameter
 987+ * functionality), or if it is true then use global object
 988+ * for the wiki's content language.
988989 * @return Language object
989990 */
990991 function wfGetLangObj( $langcode = false ) {
@@ -2166,7 +2167,7 @@
21672168 function wfNegotiateType( $cprefs, $sprefs ) {
21682169 $combine = array();
21692170
2170 - foreach( array_keys($sprefs) as $type ) {
 2171+ foreach( array_keys( $sprefs ) as $type ) {
21712172 $parts = explode( '/', $type );
21722173 if( $parts[1] != '*' ) {
21732174 $ckey = mimeTypeMatch( $type, $cprefs );
@@ -2218,7 +2219,7 @@
22192220 } else {
22202221 if ( !$suppressCount ) {
22212222 // E_DEPRECATED is undefined in PHP 5.2
2222 - if( !defined( 'E_DEPRECATED' ) ){
 2223+ if( !defined( 'E_DEPRECATED' ) ) {
22232224 define( 'E_DEPRECATED', 8192 );
22242225 }
22252226 $originalLevel = error_reporting( E_ALL & ~( E_WARNING | E_NOTICE | E_USER_WARNING | E_USER_NOTICE | E_DEPRECATED ) );
@@ -2331,7 +2332,7 @@
23322333 # TS_POSTGRES
23332334 } elseif ( preg_match( '/^(\d{4})\-(\d\d)\-(\d\d) (\d\d):(\d\d):(\d\d)\.*\d* GMT$/', $ts, $da ) ) {
23342335 # TS_POSTGRES
2335 - } elseif (preg_match('/^(\d{4})\-(\d\d)\-(\d\d) (\d\d):(\d\d):(\d\d)\.\d\d\d$/',$ts,$da)) {
 2336+ } elseif (preg_match( '/^(\d{4})\-(\d\d)\-(\d\d) (\d\d):(\d\d):(\d\d)\.\d\d\d$/', $ts, $da ) ) {
23362337 # TS_DB2
23372338 } elseif ( preg_match( '/^[ \t\r\n]*([A-Z][a-z]{2},[ \t\r\n]*)?' . # Day of week
23382339 '\d\d?[ \t\r\n]*[A-Z][a-z]{2}[ \t\r\n]*\d{2}(?:\d{2})?' . # dd Mon yyyy
@@ -3347,7 +3348,7 @@
33483349 * @param $version String
33493350 * @return null
33503351 */
3351 -function wfDeprecated( $function, $version=false ) {
 3352+function wfDeprecated( $function, $version = false ) {
33523353 static $functionsWarned = array();
33533354 if ( !isset( $functionsWarned[$function] ) ) {
33543355 $functionsWarned[$function] = true;
@@ -3567,7 +3568,7 @@
35683569 foreach ( $codeSegment as $segNo => $seg ) {
35693570 if ( count( $codeSegment ) > 0 ) {
35703571 // when previous segment is x, it is a private segment and should be lc
3571 - if( $segNo > 0 && strtolower( $codeSegment[($segNo - 1)] ) == 'x') {
 3572+ if( $segNo > 0 && strtolower( $codeSegment[( $segNo - 1 )] ) == 'x' ) {
35723573 $codeBCP[$segNo] = strtolower( $seg );
35733574 // ISO 3166 country code
35743575 } elseif ( ( strlen( $seg ) == 2 ) && ( $segNo > 0 ) ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r2969Added code to implement Dublin Core and Creative Commons RDF metadata....evanprodromou21:58, 4 April 2004
r72134DB2: Implemented prepared statements for INSERT and UPDATE to allow more than...leonsp18:14, 1 September 2010
r81597bugfix for wfBCP47 and code coverage...hashar14:47, 6 February 2011
r86368Follow-up r86113: define E_DEPRECATED for PHP 5.2happy-melon23:36, 18 April 2011
r88447Groupped array manipulation functions at the top of GlobalFunctions.phpialex10:55, 20 May 2011
r97136Add support for a second argument to wfDeprecated so we can start using it ri...dantman02:10, 15 September 2011

Status & tagging log