Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -50,7 +50,7 @@ |
51 | 51 | function mb_strpos( $haystack, $needle, $offset = 0, $encoding = '' ) { |
52 | 52 | return Fallback::mb_strpos( $haystack, $needle, $offset, $encoding ); |
53 | 53 | } |
54 | | - |
| 54 | + |
55 | 55 | } |
56 | 56 | |
57 | 57 | if( !function_exists( 'mb_strrpos' ) ) { |
— | — | @@ -316,8 +316,8 @@ |
317 | 317 | * "days=7&limit=100". Options in the first array override options in the second. |
318 | 318 | * Options set to "" will not be output. |
319 | 319 | * |
320 | | - * @param $array1 Array( String|Array ) |
321 | | - * @param $array2 Array( String|Array ) |
| 320 | + * @param $array1 Array ( String|Array ) |
| 321 | + * @param $array2 Array ( String|Array ) |
322 | 322 | * @param $prefix String |
323 | 323 | * @return String |
324 | 324 | */ |
— | — | @@ -511,7 +511,7 @@ |
512 | 512 | /* Provide an empty host for eg. file:/// urls (see bug 28627) */ |
513 | 513 | if ( !isset( $bits['host'] ) ) { |
514 | 514 | $bits['host'] = ''; |
515 | | - |
| 515 | + |
516 | 516 | /* parse_url loses the third / for file:///c:/ urls (but not on variants) */ |
517 | 517 | if ( substr( $bits['path'], 0, 1 ) !== '/' ) { |
518 | 518 | $bits['path'] = '/' . $bits['path']; |
— | — | @@ -623,10 +623,10 @@ |
624 | 624 | } |
625 | 625 | # Check for raw action using $_GET not $wgRequest, since the latter might not be initialised yet |
626 | 626 | if ( ( isset( $_GET['action'] ) && $_GET['action'] == 'raw' ) |
627 | | - || ( |
628 | | - isset( $_SERVER['SCRIPT_NAME'] ) |
629 | | - && substr( $_SERVER['SCRIPT_NAME'], -8 ) == 'load.php' |
630 | | - ) ) |
| 627 | + || ( |
| 628 | + isset( $_SERVER['SCRIPT_NAME'] ) |
| 629 | + && substr( $_SERVER['SCRIPT_NAME'], -8 ) == 'load.php' |
| 630 | + ) ) |
631 | 631 | { |
632 | 632 | $cache = true; |
633 | 633 | } else { |
— | — | @@ -637,7 +637,7 @@ |
638 | 638 | |
639 | 639 | /** |
640 | 640 | * Get microsecond timestamps for debug logs |
641 | | - * |
| 641 | + * |
642 | 642 | * @return string |
643 | 643 | */ |
644 | 644 | function wfDebugTimer() { |
— | — | @@ -1277,7 +1277,7 @@ |
1278 | 1278 | * Fetch server name for use in error reporting etc. |
1279 | 1279 | * Use real server name if available, so we know which machine |
1280 | 1280 | * in a server farm generated the current page. |
1281 | | - * |
| 1281 | + * |
1282 | 1282 | * @return string |
1283 | 1283 | */ |
1284 | 1284 | function wfHostname() { |
— | — | @@ -2538,7 +2538,7 @@ |
2539 | 2539 | function in_string( $needle, $str, $insensitive = false ) { |
2540 | 2540 | $func = 'strpos'; |
2541 | 2541 | if( $insensitive ) $func = 'stripos'; |
2542 | | - |
| 2542 | + |
2543 | 2543 | return $func( $str, $needle ) !== false; |
2544 | 2544 | } |
2545 | 2545 | |
— | — | @@ -2996,11 +2996,11 @@ |
2997 | 2997 | global $IP; |
2998 | 2998 | require_once( "$IP/includes/cache/MemcachedSessions.php" ); |
2999 | 2999 | } |
3000 | | - session_set_save_handler( 'memsess_open', 'memsess_close', 'memsess_read', |
| 3000 | + session_set_save_handler( 'memsess_open', 'memsess_close', 'memsess_read', |
3001 | 3001 | 'memsess_write', 'memsess_destroy', 'memsess_gc' ); |
3002 | 3002 | |
3003 | | - // It's necessary to register a shutdown function to call session_write_close(), |
3004 | | - // because by the time the request shutdown function for the session module is |
| 3003 | + // It's necessary to register a shutdown function to call session_write_close(), |
| 3004 | + // because by the time the request shutdown function for the session module is |
3005 | 3005 | // called, $wgMemc has already been destroyed. Shutdown functions registered |
3006 | 3006 | // this way are called before object destruction. |
3007 | 3007 | register_shutdown_function( 'memsess_write_close' ); |
— | — | @@ -3327,7 +3327,7 @@ |
3328 | 3328 | * master position. Use this when updating very large numbers of rows, as |
3329 | 3329 | * in maintenance scripts, to avoid causing too much lag. Of course, this is |
3330 | 3330 | * a no-op if there are no slaves. |
3331 | | - * |
| 3331 | + * |
3332 | 3332 | * @param $maxLag Integer (deprecated) |
3333 | 3333 | * @param $wiki mixed Wiki identifier accepted by wfGetLB |
3334 | 3334 | * @return null |
— | — | @@ -3477,7 +3477,7 @@ |
3478 | 3478 | $codeBCP = array(); |
3479 | 3479 | foreach ( $codeSegment as $segNo => $seg ) { |
3480 | 3480 | if ( count( $codeSegment ) > 0 ) { |
3481 | | - // when previous segment is x, it is a private segment and should be lc |
| 3481 | + // when previous segment is x, it is a private segment and should be lc |
3482 | 3482 | if( $segNo > 0 && strtolower( $codeSegment[($segNo - 1)] ) == 'x') { |
3483 | 3483 | $codeBCP[$segNo] = strtolower( $seg ); |
3484 | 3484 | // ISO 3166 country code |
— | — | @@ -3551,9 +3551,9 @@ |
3552 | 3552 | } |
3553 | 3553 | |
3554 | 3554 | /** |
3555 | | - * Unserialize a string to a PHP value without throwing E_NOTICE. Simply a |
| 3555 | + * Unserialize a string to a PHP value without throwing E_NOTICE. Simply a |
3556 | 3556 | * wrapper around unserialize() |
3557 | | - * |
| 3557 | + * |
3558 | 3558 | * @param $data string The serialized string |
3559 | 3559 | * @return mixed |
3560 | 3560 | */ |
Index: trunk/phase3/includes/WebRequest.php |
— | — | @@ -127,6 +127,8 @@ |
128 | 128 | /** |
129 | 129 | * Work out an appropriate URL prefix containing scheme and host, based on |
130 | 130 | * information detected from $_SERVER |
| 131 | + * |
| 132 | + * @return string |
131 | 133 | */ |
132 | 134 | public static function detectServer() { |
133 | 135 | if ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == 'on') { |
— | — | @@ -196,7 +198,7 @@ |
197 | 199 | * passed on as the value of this URL parameter |
198 | 200 | * @return array of URL variables to interpolate; empty if no match |
199 | 201 | */ |
200 | | - private static function extractTitle( $path, $bases, $key=false ) { |
| 202 | + private static function extractTitle( $path, $bases, $key = false ) { |
201 | 203 | foreach( (array)$bases as $keyValue => $base ) { |
202 | 204 | // Find the part after $wgArticlePath |
203 | 205 | $base = str_replace( '$1', '', $base ); |
— | — | @@ -464,6 +466,8 @@ |
465 | 467 | * Extracts the given named values into an array. |
466 | 468 | * If no arguments are given, returns all input values. |
467 | 469 | * No transformation is performed on the values. |
| 470 | + * |
| 471 | + * @return array |
468 | 472 | */ |
469 | 473 | public function getValues() { |
470 | 474 | $names = func_get_args(); |
— | — | @@ -606,6 +610,12 @@ |
607 | 611 | return htmlspecialchars( $this->appendQuery( $query ) ); |
608 | 612 | } |
609 | 613 | |
| 614 | + /** |
| 615 | + * @param $key |
| 616 | + * @param $value |
| 617 | + * @param $onlyquery bool |
| 618 | + * @return String |
| 619 | + */ |
610 | 620 | public function appendQueryValue( $key, $value, $onlyquery = false ) { |
611 | 621 | return $this->appendQueryArray( array( $key => $value ), $onlyquery ); |
612 | 622 | } |
— | — | @@ -714,7 +724,7 @@ |
715 | 725 | /** |
716 | 726 | * Return a WebRequestUpload object corresponding to the key |
717 | 727 | * |
718 | | - * @param @key string |
| 728 | + * @param $key string |
719 | 729 | * @return WebRequestUpload |
720 | 730 | */ |
721 | 731 | public function getUpload( $key ) { |
— | — | @@ -749,7 +759,6 @@ |
750 | 760 | $this->headers[ strtoupper( $tempName ) ] = $tempValue; |
751 | 761 | } |
752 | 762 | } else { |
753 | | - $headers = $_SERVER; |
754 | 763 | foreach ( $_SERVER as $name => $value ) { |
755 | 764 | if ( substr( $name, 0, 5 ) === 'HTTP_' ) { |
756 | 765 | $name = str_replace( '_', '-', substr( $name, 5 ) ); |
— | — | @@ -774,6 +783,8 @@ |
775 | 784 | /** |
776 | 785 | * Get a request header, or false if it isn't set |
777 | 786 | * @param $name String: case-insensitive header name |
| 787 | + * |
| 788 | + * @return string|false |
778 | 789 | */ |
779 | 790 | public function getHeader( $name ) { |
780 | 791 | $this->initHeaders(); |
— | — | @@ -813,6 +824,9 @@ |
814 | 825 | * PATH_INFO or QUERY_STRING. If the request can't be allowed, show an error |
815 | 826 | * message or redirect to a safer URL. Returns true if the URL is OK, and |
816 | 827 | * false if an error message has been shown and the request should be aborted. |
| 828 | + * |
| 829 | + * @param $extWhitelist array |
| 830 | + * @return bool |
817 | 831 | */ |
818 | 832 | public function checkUrlExtension( $extWhitelist = array() ) { |
819 | 833 | global $wgScriptExtension; |
— | — | @@ -837,6 +851,9 @@ |
838 | 852 | /** |
839 | 853 | * Attempt to redirect to a URL with a QUERY_STRING that's not dangerous in |
840 | 854 | * IE 6. Returns true if it was successful, false otherwise. |
| 855 | + * |
| 856 | + * @param $url string |
| 857 | + * @return bool |
841 | 858 | */ |
842 | 859 | protected function doSecurityRedirect( $url ) { |
843 | 860 | header( 'Location: ' . $url ); |
Index: trunk/phase3/includes/specials/SpecialNewpages.php |
— | — | @@ -440,7 +440,7 @@ |
441 | 441 | $revision = Revision::newFromId( $row->rev_id ); |
442 | 442 | if( $revision ) { |
443 | 443 | return '<p>' . htmlspecialchars( $revision->getUserText() ) . wfMsgForContent( 'colon-separator' ) . |
444 | | - htmlspecialchars( FeedItem::stripComment( $revision->getComment() ) ) . |
| 444 | + htmlspecialchars( FeedItem::stripComment( $revision->getComment() ) ) . |
445 | 445 | "</p>\n<hr />\n<div>" . |
446 | 446 | nl2br( htmlspecialchars( $revision->getText() ) ) . "</div>"; |
447 | 447 | } |
— | — | @@ -453,14 +453,22 @@ |
454 | 454 | */ |
455 | 455 | class NewPagesPager extends ReverseChronologicalPager { |
456 | 456 | // Stored opts |
457 | | - protected $opts, $mForm; |
| 457 | + protected $opts; |
458 | 458 | |
| 459 | + /** |
| 460 | + * @var HtmlForm |
| 461 | + */ |
| 462 | + protected $mForm; |
| 463 | + |
459 | 464 | function __construct( $form, FormOptions $opts ) { |
460 | 465 | parent::__construct(); |
461 | 466 | $this->mForm = $form; |
462 | 467 | $this->opts = $opts; |
463 | 468 | } |
464 | 469 | |
| 470 | + /** |
| 471 | + * @return Title |
| 472 | + */ |
465 | 473 | function getTitle() { |
466 | 474 | static $title = null; |
467 | 475 | if ( $title === null ) { |
— | — | @@ -469,6 +477,9 @@ |
470 | 478 | return $title; |
471 | 479 | } |
472 | 480 | |
| 481 | + /** |
| 482 | + * @return User |
| 483 | + */ |
473 | 484 | function getUser() { |
474 | 485 | static $user = null; |
475 | 486 | if ( $user === null ) { |
— | — | @@ -514,7 +525,7 @@ |
515 | 526 | if ( $this->opts->getValue( 'hideredirs' ) ) { |
516 | 527 | $conds['page_is_redirect'] = 0; |
517 | 528 | } |
518 | | - |
| 529 | + |
519 | 530 | // Allow changes to the New Pages query |
520 | 531 | $tables = array( 'recentchanges', 'page' ); |
521 | 532 | $fields = array( |