Index: branches/REL1_18/phase3/includes/GlobalFunctions.php |
— | — | @@ -2727,6 +2727,15 @@ |
2728 | 2728 | return false; |
2729 | 2729 | } |
2730 | 2730 | |
| 2731 | + /* Provide an empty host for eg. file:/// urls (see bug 28627) */ |
| 2732 | + if ( !isset( $bits['host'] ) ) { |
| 2733 | + $bits['host'] = ''; |
| 2734 | + |
| 2735 | + /* parse_url loses the third / for file:///c:/ urls (but not on variants) */ |
| 2736 | + if ( substr( $bits['path'], 0, 1 ) !== '/' ) { |
| 2737 | + $bits['path'] = '/' . $bits['path']; |
| 2738 | + } |
| 2739 | + } |
2731 | 2740 | return $bits; |
2732 | 2741 | } |
2733 | 2742 | |
— | — | @@ -2750,12 +2759,8 @@ |
2751 | 2760 | $domainpart = ''; |
2752 | 2761 | } |
2753 | 2762 | $reversedHost = $domainpart . '@' . $mailparts[0]; |
2754 | | - } else if ( isset( $bits['host'] ) ) { |
2755 | | - $reversedHost = strtolower( implode( '.', array_reverse( explode( '.', $bits['host'] ) ) ) ); |
2756 | 2763 | } else { |
2757 | | - // In file: URIs for instance it's common to have an empty host, |
2758 | | - // which turns up as not getting a 'host' member from parse_url. |
2759 | | - $reversedHost = '.'; |
| 2764 | + $reversedHost = strtolower( implode( '.', array_reverse( explode( '.', $bits['host'] ) ) ) ); |
2760 | 2765 | } |
2761 | 2766 | // Add an extra dot to the end |
2762 | 2767 | // Why? Is it in wrong place in mailto links? |
— | — | @@ -2770,13 +2775,6 @@ |
2771 | 2776 | $index .= ':' . $bits['port']; |
2772 | 2777 | } |
2773 | 2778 | if ( isset( $bits['path'] ) ) { |
2774 | | - // parse_url() removes the initial '/' from the path |
2775 | | - // for file: URLs with Windows-style paths, such as |
2776 | | - // file:///c:/windows/stuff. We need to add it back |
2777 | | - // to keep our division between host and path properly. |
2778 | | - if ( strlen( $bits['path'] ) > 0 && substr( $bits['path'], 0, 1 ) !== '/' ) { |
2779 | | - $index .= '/'; |
2780 | | - } |
2781 | 2779 | $index .= $bits['path']; |
2782 | 2780 | } else { |
2783 | 2781 | $index .= '/'; |
Property changes on: branches/REL1_18/phase3/includes/GlobalFunctions.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
2784 | 2782 | Merged /trunk/phase3/includes/GlobalFunctions.php:r90084 |
Index: branches/REL1_18/phase3/includes/filerepo/OldLocalFile.php |
— | — | @@ -221,10 +221,12 @@ |
222 | 222 | */ |
223 | 223 | function uploadOld( $srcPath, $archiveName, $timestamp, $comment, $user, $flags = 0 ) { |
224 | 224 | $this->lock(); |
225 | | - $status = $this->publish( $srcPath, |
226 | | - $flags & File::DELETE_SOURCE ? FileRepo::DELETE_SOURCE : 0, |
227 | | - $archiveName ); |
228 | 225 | |
| 226 | + $dstRel = 'archive/' . $this->getHashPath() . $archiveName; |
| 227 | + $status = $this->publishTo( $srcPath, $dstRel, |
| 228 | + $flags & File::DELETE_SOURCE ? FileRepo::DELETE_SOURCE : 0 |
| 229 | + ); |
| 230 | + |
229 | 231 | if ( $status->isGood() ) { |
230 | 232 | if ( !$this->recordOldUpload( $srcPath, $archiveName, $timestamp, $comment, $user ) ) { |
231 | 233 | $status->fatal( 'filenotfound', $srcPath ); |
Index: branches/REL1_18/phase3/includes/filerepo/LocalFile.php |
— | — | @@ -1051,20 +1051,30 @@ |
1052 | 1052 | * @param $srcPath String: local filesystem path to the source image |
1053 | 1053 | * @param $flags Integer: a bitwise combination of: |
1054 | 1054 | * File::DELETE_SOURCE Delete the source file, i.e. move rather than copy |
1055 | | - * @param $dstArchiveName string File name if the file is to be published |
1056 | | - * into the archive |
1057 | 1055 | * @return FileRepoStatus object. On success, the value member contains the |
1058 | 1056 | * archive name, or an empty string if it was a new file. |
1059 | 1057 | */ |
1060 | | - function publish( $srcPath, $flags = 0, $dstArchiveName = null ) { |
| 1058 | + function publish( $srcPath, $flags = 0 ) { |
| 1059 | + return $this->publishTo( $srcPath, $this->getRel(), $flags ); |
| 1060 | + } |
| 1061 | + |
| 1062 | + /** |
| 1063 | + * Move or copy a file to a specified location. Returns a FileRepoStatus |
| 1064 | + * object with the archive name in the "value" member on success. |
| 1065 | + * |
| 1066 | + * The archive name should be passed through to recordUpload for database |
| 1067 | + * registration. |
| 1068 | + * |
| 1069 | + * @param $srcPath String: local filesystem path to the source image |
| 1070 | + * @param $dstRel String: target relative path |
| 1071 | + * @param $flags Integer: a bitwise combination of: |
| 1072 | + * File::DELETE_SOURCE Delete the source file, i.e. move rather than copy |
| 1073 | + * @return FileRepoStatus object. On success, the value member contains the |
| 1074 | + * archive name, or an empty string if it was a new file. |
| 1075 | + */ |
| 1076 | + function publishTo( $srcPath, $dstRel, $flags = 0 ) { |
1061 | 1077 | $this->lock(); |
1062 | | - |
1063 | | - if ( $dstArchiveName ) { |
1064 | | - $dstRel = 'archive/' . $this->getHashPath() . $dstArchiveName; |
1065 | | - } else { |
1066 | | - $dstRel = $this->getRel(); |
1067 | | - } |
1068 | | - |
| 1078 | + |
1069 | 1079 | $archiveName = wfTimestamp( TS_MW ) . '!'. $this->getName(); |
1070 | 1080 | $archiveRel = 'archive/' . $this->getHashPath() . $archiveName; |
1071 | 1081 | $flags = $flags & File::DELETE_SOURCE ? LocalRepo::DELETE_SOURCE : 0; |
Property changes on: branches/REL1_18/phase3/includes/filerepo/File.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1072 | 1082 | Merged /trunk/phase3/includes/filerepo/File.php:r90296 |
Property changes on: branches/REL1_18/phase3/includes/filerepo |
___________________________________________________________________ |
Added: svn:mergeinfo |
1073 | 1083 | Merged /branches/sqlite/includes/filerepo:r58211-58321 |
1074 | 1084 | Merged /trunk/phase3/includes/filerepo:r87586,87627-87628,87630,87840,87998,88085,88118,88124,88134,88231-88232,88250,88492,88498,88513,89099,89108,90296,90602,90612,90618,90626,90630-90631,90637,90655,90657,90666,90812 |
1075 | 1085 | Merged /branches/new-installer/phase3/includes/filerepo:r43664-66004 |
1076 | 1086 | Merged /branches/wmf-deployment/includes/filerepo:r53381 |
1077 | 1087 | Merged /branches/REL1_15/phase3/includes/filerepo:r51646 |
Property changes on: branches/REL1_18/phase3/includes/installer/Installer.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1078 | 1088 | Merged /trunk/phase3/includes/installer/Installer.php:r89311 |
Property changes on: branches/REL1_18/phase3/includes/installer/DatabaseInstaller.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1079 | 1089 | Merged /trunk/phase3/includes/installer/DatabaseInstaller.php:r89311 |
Property changes on: branches/REL1_18/phase3/includes/installer/SqliteUpdater.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1080 | 1090 | Merged /trunk/phase3/includes/installer/SqliteUpdater.php:r89311 |
Property changes on: branches/REL1_18/phase3/includes/installer |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1081 | 1091 | Merged /trunk/phase3/includes/installer:r89311 |
Index: branches/REL1_18/phase3/includes/api/ApiEditPage.php |
— | — | @@ -65,8 +65,6 @@ |
66 | 66 | $titles = Title::newFromRedirectArray( Revision::newFromTitle( $oldTitle )->getText( Revision::FOR_THIS_USER ) ); |
67 | 67 | // array_shift( $titles ); |
68 | 68 | |
69 | | - $this->getResult()->addValue( null, 'foo', $titles ); |
70 | | - |
71 | 69 | $redirValues = array(); |
72 | 70 | foreach ( $titles as $id => $newTitle ) { |
73 | 71 | |
Property changes on: branches/REL1_18/phase3/includes/api/ApiEditPage.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
74 | 72 | Merged /branches/REL1_15/phase3/includes/api/ApiEditPage.php:r51646 |
75 | 73 | Merged /branches/REL1_16/phase3/includes/api/ApiEditPage.php:r63621-63636,69357 |
76 | 74 | Merged /branches/wmf/1.16wmf4/includes/api/ApiEditPage.php:r69521 |
77 | 75 | Merged /branches/sqlite/includes/api/ApiEditPage.php:r58211-58321 |
78 | 76 | Merged /trunk/phase3/includes/api/ApiEditPage.php:r87627-87628,87630,87998,88134,88231-88232,88250,88513,89099,89108,90490,90602,90612,90618,90626,90630-90631,90637,90655,90657,90666,90812 |
79 | 77 | Merged /branches/wmf-deployment/includes/api/ApiEditPage.php:r53381,59952 |
Index: branches/REL1_18/phase3/includes/specials/SpecialUndelete.php |
— | — | @@ -564,7 +564,7 @@ |
565 | 565 | * @ingroup SpecialPage |
566 | 566 | */ |
567 | 567 | class SpecialUndelete extends SpecialPage { |
568 | | - var $mAction, $mTarget, $mTimestamp, $mRestore, $mInvert, $mTargetObj, $mFile; |
| 568 | + var $mAction, $mTarget, $mTimestamp, $mRestore, $mInvert, $mTargetObj, $mFilename; |
569 | 569 | var $mTargetTimestamp, $mAllowed, $mCanView, $mComment, $mToken, $mRequest; |
570 | 570 | |
571 | 571 | function __construct( $request = null ) { |
— | — | @@ -585,7 +585,7 @@ |
586 | 586 | $this->mSearchPrefix = $this->mRequest->getText( 'prefix' ); |
587 | 587 | $time = $this->mRequest->getVal( 'timestamp' ); |
588 | 588 | $this->mTimestamp = $time ? wfTimestamp( TS_MW, $time ) : ''; |
589 | | - $this->mFile = $this->mRequest->getVal( 'file' ); |
| 589 | + $this->mFilename = $this->mRequest->getVal( 'file' ); |
590 | 590 | |
591 | 591 | $posted = $this->mRequest->wasPosted() && |
592 | 592 | $wgUser->matchEditToken( $this->mRequest->getVal( 'wpEditToken' ) ); |
— | — | @@ -674,11 +674,11 @@ |
675 | 675 | if( $this->mTimestamp !== '' ) { |
676 | 676 | return $this->showRevision( $this->mTimestamp ); |
677 | 677 | } |
678 | | - if( $this->mFile !== null ) { |
679 | | - $file = new ArchivedFile( $this->mTargetObj, '', $this->mFile ); |
| 678 | + if( $this->mFilename !== null ) { |
| 679 | + $file = new ArchivedFile( $this->mTargetObj, '', $this->mFilename ); |
680 | 680 | // Check if user is allowed to see this file |
681 | 681 | if ( !$file->exists() ) { |
682 | | - $wgOut->addWikiMsg( 'filedelete-nofile', $this->mFile ); |
| 682 | + $wgOut->addWikiMsg( 'filedelete-nofile', $this->mFilename ); |
683 | 683 | return; |
684 | 684 | } else if( !$file->userCan( File::DELETED_FILE ) ) { |
685 | 685 | if( $file->isDeleted( File::DELETED_RESTRICTED ) ) { |
— | — | @@ -687,11 +687,11 @@ |
688 | 688 | $wgOut->permissionRequired( 'deletedtext' ); |
689 | 689 | } |
690 | 690 | return false; |
691 | | - } elseif ( !$wgUser->matchEditToken( $this->mToken, $this->mFile ) ) { |
692 | | - $this->showFileConfirmationForm( $this->mFile ); |
| 691 | + } elseif ( !$wgUser->matchEditToken( $this->mToken, $this->mFilename ) ) { |
| 692 | + $this->showFileConfirmationForm( $this->mFilename ); |
693 | 693 | return false; |
694 | 694 | } else { |
695 | | - return $this->showFile( $this->mFile ); |
| 695 | + return $this->showFile( $this->mFilename ); |
696 | 696 | } |
697 | 697 | } |
698 | 698 | if( $this->mRestore && $this->mAction == "submit" ) { |
— | — | @@ -985,7 +985,7 @@ |
986 | 986 | */ |
987 | 987 | private function showFileConfirmationForm( $key ) { |
988 | 988 | global $wgOut, $wgUser, $wgLang; |
989 | | - $file = new ArchivedFile( $this->mTargetObj, '', $this->mFile ); |
| 989 | + $file = new ArchivedFile( $this->mTargetObj, '', $this->mFilename ); |
990 | 990 | $wgOut->addWikiMsg( 'undelete-show-file-confirm', |
991 | 991 | $this->mTargetObj->getText(), |
992 | 992 | $wgLang->date( $file->getTimestamp() ), |
Property changes on: branches/REL1_18/phase3/includes/specials/SpecialUndelete.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
993 | 993 | Merged /branches/wmf-deployment/includes/specials/SpecialUndelete.php:r53381,56967 |
994 | 994 | Merged /branches/REL1_15/phase3/includes/specials/SpecialUndelete.php:r51646 |
995 | 995 | Merged /branches/sqlite/includes/specials/SpecialUndelete.php:r58211-58321 |
996 | 996 | Merged /trunk/phase3/includes/specials/SpecialUndelete.php:r87586,87627-87628,87630,87840,87998,88085,88118,88124,88134,88231-88232,88250,88492,88498,88513,89099,89108,90093,90602,90612,90618,90626,90630-90631,90637,90655,90657,90666,90812 |