Index: trunk/phase3/includes/ProxyTools.php |
— | — | @@ -12,10 +12,11 @@ |
13 | 13 | * @return string |
14 | 14 | */ |
15 | 15 | function wfGetForwardedFor() { |
16 | | - if( function_exists( 'apache_request_headers' ) ) { |
| 16 | + $apacheHeaders = function_exists( 'apache_request_headers' ) ? apache_request_headers() : null; |
| 17 | + if( is_array( $apacheHeaders ) ) { |
17 | 18 | // More reliable than $_SERVER due to case and -/_ folding |
18 | 19 | $set = array (); |
19 | | - foreach ( apache_request_headers() as $tempName => $tempValue ) { |
| 20 | + foreach ( $apacheHeaders as $tempName => $tempValue ) { |
20 | 21 | $set[ strtoupper( $tempName ) ] = $tempValue; |
21 | 22 | } |
22 | 23 | $index = strtoupper ( 'X-Forwarded-For' ); |
Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -1461,15 +1461,16 @@ |
1462 | 1462 | $toolbox['print']['rel'] = 'alternate'; |
1463 | 1463 | $toolbox['print']['msg'] = 'printableversion'; |
1464 | 1464 | } |
1465 | | - if ( !empty( $this->data['nav_urls']['permalink']['href'] ) ) { |
| 1465 | + if( $this->data['nav_urls']['permalink'] ) { |
1466 | 1466 | $toolbox['permalink'] = $this->data['nav_urls']['permalink']; |
1467 | | - $toolbox['permalink']['id'] = 't-permalink'; |
1468 | | - } elseif ( $this->data['nav_urls']['permalink']['href'] === '' ) { |
1469 | | - $toolbox['permalink'] = $this->data['nav_urls']['permalink']; |
1470 | | - unset( $toolbox['permalink']['href'] ); |
1471 | | - $toolbox['ispermalink']['tooltiponly'] = true; |
1472 | | - $toolbox['ispermalink']['id'] = 't-ispermalink'; |
1473 | | - $toolbox['ispermalink']['msg'] = 'permalink'; |
| 1467 | + if( $toolbox['permalink']['href'] === '' ) { |
| 1468 | + unset( $toolbox['permalink']['href'] ); |
| 1469 | + $toolbox['ispermalink']['tooltiponly'] = true; |
| 1470 | + $toolbox['ispermalink']['id'] = 't-ispermalink'; |
| 1471 | + $toolbox['ispermalink']['msg'] = 'permalink'; |
| 1472 | + } else { |
| 1473 | + $toolbox['permalink']['id'] = 't-permalink'; |
| 1474 | + } |
1474 | 1475 | } |
1475 | 1476 | wfRunHooks( 'BaseTemplateToolbox', array( &$this, &$toolbox ) ); |
1476 | 1477 | wfProfileOut( __METHOD__ ); |
Index: trunk/phase3/languages/classes/LanguageKaa.php |
— | — | @@ -24,13 +24,11 @@ |
25 | 25 | * |
26 | 26 | */ |
27 | 27 | function ucfirst ( $string ) { |
28 | | - if ( $string[0] == 'i' ) { |
29 | | - $string = 'İ' . substr( $string, 1 ); |
| 28 | + if ( substr( $string, 0, 1 ) === 'i' ) { |
| 29 | + return 'İ' . substr( $string, 1 ); |
30 | 30 | } else { |
31 | | - $string = parent::ucfirst( $string ); |
| 31 | + return parent::ucfirst( $string ); |
32 | 32 | } |
33 | | - return $string; |
34 | | - |
35 | 33 | } |
36 | 34 | |
37 | 35 | /* |
— | — | @@ -38,12 +36,11 @@ |
39 | 37 | * |
40 | 38 | */ |
41 | 39 | function lcfirst ( $string ) { |
42 | | - if ( $string[0] == 'I' ) { |
43 | | - $string = 'ı' . substr( $string, 1 ); |
| 40 | + if ( substr( $string, 0, 1 ) === 'I' ) { |
| 41 | + return 'ı' . substr( $string, 1 ); |
44 | 42 | } else { |
45 | | - $string = parent::lcfirst( $string ); |
| 43 | + return parent::lcfirst( $string ); |
46 | 44 | } |
47 | | - return $string; |
48 | 45 | } |
49 | 46 | |
50 | 47 | /** |