Index: branches/REL1_18/phase3/includes/upload/UploadStash.php |
— | — | @@ -219,18 +219,18 @@ |
220 | 220 | wfDebug( __METHOD__ . " key for '$path': $key\n" ); |
221 | 221 | |
222 | 222 | // if not already in a temporary area, put it there |
223 | | - $storeResult = $this->repo->storeTemp( basename( $path ), $path ); |
| 223 | + $storeStatus = $this->repo->storeTemp( basename( $path ), $path ); |
224 | 224 | |
225 | | - if ( ! $storeResult->isOK() ) { |
| 225 | + if ( ! $storeStatus->isOK() ) { |
226 | 226 | // It is a convention in MediaWiki to only return one error per API exception, even if multiple errors |
227 | 227 | // are available. We use reset() to pick the "first" thing that was wrong, preferring errors to warnings. |
228 | | - // This is a bit lame, as we may have more info in the $storeResult and we're throwing it away, but to fix it means |
| 228 | + // This is a bit lame, as we may have more info in the $storeStatus and we're throwing it away, but to fix it means |
229 | 229 | // redesigning API errors significantly. |
230 | | - // $storeResult->value just contains the virtual URL (if anything) which is probably useless to the caller |
231 | | - $error = $storeResult->getErrorsArray(); |
| 230 | + // $storeStatus->value just contains the virtual URL (if anything) which is probably useless to the caller |
| 231 | + $error = $storeStatus->getErrorsArray(); |
232 | 232 | $error = reset( $error ); |
233 | 233 | if ( ! count( $error ) ) { |
234 | | - $error = $storeResult->getWarningsArray(); |
| 234 | + $error = $storeStatus->getWarningsArray(); |
235 | 235 | $error = reset( $error ); |
236 | 236 | if ( ! count( $error ) ) { |
237 | 237 | $error = array( 'unknown', 'no error recorded' ); |
— | — | @@ -238,11 +238,10 @@ |
239 | 239 | } |
240 | 240 | throw new UploadStashFileException( "error storing file in '$path': " . implode( '; ', $error ) ); |
241 | 241 | } |
242 | | - $stashPath = $storeResult->value; |
| 242 | + $stashPath = $storeStatus->value; |
243 | 243 | |
244 | 244 | // fetch the current user ID |
245 | 245 | if ( !$this->isLoggedIn ) { |
246 | | - wfDebugCallstack(); |
247 | 246 | throw new UploadStashNotLoggedInException( __METHOD__ . ' No user is logged in, files must belong to users' ); |
248 | 247 | } |
249 | 248 | |
Property changes on: branches/REL1_18/phase3/includes/upload/UploadStash.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
250 | 249 | Merged /trunk/phase3/includes/upload/UploadStash.php:r93065,93834 |
Index: branches/REL1_18/phase3/includes/installer/WebInstaller.php |
— | — | @@ -1053,4 +1053,27 @@ |
1054 | 1054 | $img . ' ' . wfMsgHtml( 'config-download-localsettings' ) ); |
1055 | 1055 | return Html::rawElement( 'div', array( 'class' => 'config-download-link' ), $anchor ); |
1056 | 1056 | } |
| 1057 | + |
| 1058 | + public function envCheckPath( ) { |
| 1059 | + // PHP_SELF isn't available sometimes, such as when PHP is CGI but |
| 1060 | + // cgi.fix_pathinfo is disabled. In that case, fall back to SCRIPT_NAME |
| 1061 | + // to get the path to the current script... hopefully it's reliable. SIGH |
| 1062 | + $path = false; |
| 1063 | + if ( !empty( $_SERVER['PHP_SELF'] ) ) { |
| 1064 | + $path = $_SERVER['PHP_SELF']; |
| 1065 | + } elseif ( !empty( $_SERVER['SCRIPT_NAME'] ) ) { |
| 1066 | + $path = $_SERVER['SCRIPT_NAME']; |
| 1067 | + } |
| 1068 | + if ($path !== false) { |
| 1069 | + $uri = preg_replace( '{^(.*)/(mw-)?config.*$}', '$1', $path ); |
| 1070 | + $this->setVar( 'wgScriptPath', $uri ); |
| 1071 | + } else { |
| 1072 | + $this->showError( 'config-no-uri' ); |
| 1073 | + return false; |
| 1074 | + } |
| 1075 | + |
| 1076 | + |
| 1077 | + return parent::envCheckPath(); |
| 1078 | + } |
| 1079 | + |
1057 | 1080 | } |
Index: branches/REL1_18/phase3/includes/installer/Installer.php |
— | — | @@ -857,19 +857,6 @@ |
858 | 858 | |
859 | 859 | $this->setVar( 'IP', $IP ); |
860 | 860 | |
861 | | - // PHP_SELF isn't available sometimes, such as when PHP is CGI but |
862 | | - // cgi.fix_pathinfo is disabled. In that case, fall back to SCRIPT_NAME |
863 | | - // to get the path to the current script... hopefully it's reliable. SIGH |
864 | | - if ( !empty( $_SERVER['PHP_SELF'] ) ) { |
865 | | - $path = $_SERVER['PHP_SELF']; |
866 | | - } elseif ( !empty( $_SERVER['SCRIPT_NAME'] ) ) { |
867 | | - $path = $_SERVER['SCRIPT_NAME']; |
868 | | - } elseif ( $this->getVar( 'wgScriptPath' ) ) { |
869 | | - // Some kind soul has set it for us already (e.g. debconf) |
870 | | - return true; |
871 | | - } else { |
872 | | - $this->showError( 'config-no-uri' ); |
873 | | - return false; |
874 | 861 | } |
875 | 862 | |
876 | 863 | $uri = preg_replace( '{^(.*)/(mw-)?config.*$}', '$1', $path ); |
Index: branches/REL1_18/phase3/includes/installer/Installer.i18n.php |
— | — | @@ -147,9 +147,12 @@ |
148 | 148 | Image thumbnailing will be disabled.', |
149 | 149 | 'config-no-uri' => "'''Error:''' Could not determine the current URI. |
150 | 150 | Installation aborted.", |
| 151 | + 'config-no-cli-uri' => "'''Warning''': No --scriptpath specified, using default: <code>$1</code>.", |
151 | 152 | 'config-using-server' => 'Using server name "<nowiki>$1</nowiki>".', |
152 | 153 | 'config-uploads-not-safe' => "'''Warning:''' Your default directory for uploads <code>$1</code> is vulnerable to arbitrary scripts execution. |
153 | 154 | Although MediaWiki checks all uploaded files for security threats, it is highly recommended to [http://www.mediawiki.org/wiki/Manual:Security#Upload_security close this security vulnerability] before enabling uploads.", |
| 155 | + 'config-no-cli-uploads-check' => "'''Warning:''' Your default directory for uploads (<code>$1</code>) is not checked for vulnerability |
| 156 | +to arbitrary script execution during the CLI install.", |
154 | 157 | 'config-brokenlibxml' => 'Your system has a combination of PHP and libxml2 versions which is buggy and can cause hidden data corruption in MediaWiki and other web applications. |
155 | 158 | Upgrade to PHP 5.2.9 or later and libxml2 2.7.3 or later ([http://bugs.php.net/bug.php?id=45996 bug filed with PHP]). |
156 | 159 | Installation aborted.', |
Index: branches/REL1_18/phase3/includes/installer/CliInstaller.php |
— | — | @@ -13,6 +13,7 @@ |
14 | 14 | * @since 1.17 |
15 | 15 | */ |
16 | 16 | class CliInstaller extends Installer { |
| 17 | + private $specifiedScriptPath = false; |
17 | 18 | |
18 | 19 | private $optionMap = array( |
19 | 20 | 'dbtype' => 'wgDBtype', |
— | — | @@ -45,6 +46,10 @@ |
46 | 47 | |
47 | 48 | parent::__construct(); |
48 | 49 | |
| 50 | + if ( isset( $option['scriptpath'] ) ) { |
| 51 | + $this->specifiedScriptPath = true; |
| 52 | + } |
| 53 | + |
49 | 54 | foreach ( $this->optionMap as $opt => $global ) { |
50 | 55 | if ( isset( $option[$opt] ) ) { |
51 | 56 | $GLOBALS[$global] = $option[$opt]; |
— | — | @@ -170,4 +175,16 @@ |
171 | 176 | exit; |
172 | 177 | } |
173 | 178 | } |
| 179 | + |
| 180 | + public function envCheckPath( ) { |
| 181 | + if ( !$this->specifiedScriptPath ) { |
| 182 | + $this->showMessage( 'config-no-cli-uri', $this->getVar("wgScriptPath") ); |
| 183 | + } |
| 184 | + return parent::envCheckPath(); |
| 185 | + } |
| 186 | + |
| 187 | + public function dirIsExecutable( $dir, $url ) { |
| 188 | + $this->showMessage( 'config-no-cli-uploads-check', $dir ); |
| 189 | + return false; |
| 190 | + } |
174 | 191 | } |
Property changes on: branches/REL1_18/phase3/includes/installer/CliInstaller.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
175 | 192 | Merged /trunk/phase3/includes/installer/CliInstaller.php:r93834 |
Index: branches/REL1_18/phase3/includes/templates/NoLocalSettings.php |
— | — | @@ -9,11 +9,18 @@ |
10 | 10 | if ( !isset( $wgVersion ) ) { |
11 | 11 | $wgVersion = 'VERSION'; |
12 | 12 | } |
13 | | -$script = $_SERVER['SCRIPT_NAME']; |
14 | | -$path = pathinfo( $script, PATHINFO_DIRNAME ) . '/'; |
15 | | -$path = str_replace( '//', '/', $path ); |
16 | | -$ext = pathinfo( $script, PATHINFO_EXTENSION ); |
17 | 13 | |
| 14 | +$matches = array(); |
| 15 | +$ext = 'php'; |
| 16 | +$path = '/'; |
| 17 | +foreach( array_filter( explode( '/', $_SERVER['PHP_SELF'] ) ) as $part ) { |
| 18 | + if( !preg_match( '/\.(php5?)$/', $part, $matches ) ) { |
| 19 | + $path .= "$part/"; |
| 20 | + } else { |
| 21 | + $ext = $matches[1] == 'php5' ? 'php5' : 'php'; |
| 22 | + } |
| 23 | +} |
| 24 | + |
18 | 25 | # Check to see if the installer is running |
19 | 26 | if ( !function_exists( 'session_name' ) ) { |
20 | 27 | $installerStarted = false; |
Property changes on: branches/REL1_18/phase3/includes |
___________________________________________________________________ |
Modified: svn:mergeinfo |
21 | 28 | Merged /trunk/phase3/includes:r93065,93834,94171 |
Index: branches/REL1_18/phase3/resources/jquery.ui/themes/vector/jquery.ui.button.css |
— | — | @@ -9,22 +9,22 @@ |
10 | 10 | |
11 | 11 | /*button text element */ |
12 | 12 | .ui-button .ui-button-text { display: block; line-height: 1.4em; } |
13 | | -.ui-button-text-only .ui-button-text { padding: .125em .25em; } |
14 | | -.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } |
15 | | -.ui-button-text-icon-primary .ui-button-text { padding: 0.1em 0.8em 0.1em 1.9em; } |
16 | | -.ui-button-text-icon-secondary .ui-button-text { padding: .1em 1.9em .1em 0.8em; } |
17 | | -.ui-button-text-icons .ui-button-text { padding: 0.1em 1.9em 0.1em 1.9em; } |
| 13 | +.ui-button-text-only .ui-button-text { padding: 0.3em 1em 0.25em 1em; } |
| 14 | +.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: 0.3em; text-indent: -9999999px; } |
| 15 | +.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: 0.3em 1em 0.25em 2.1em; } |
| 16 | +.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: 0.3em 2.1em 0.25em 1em; } |
| 17 | +.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } |
18 | 18 | /* for older versions of jQuery UI */ |
19 | | -.ui-button-text-icon .ui-button-text { padding: 0.1em 0.8em 0.1em 1.9em; } |
| 19 | +.ui-button-text-icon .ui-button-text { padding: 0.3em 1em 0.3em 2.1em; } |
20 | 20 | |
21 | 21 | /* no icon support for input elements, provide padding by default */ |
22 | | -input.ui-button { padding: .4em 1em; } |
| 22 | +input.ui-button { padding: 0.3em 1em; } |
23 | 23 | |
24 | 24 | /*button icon element(s) */ |
25 | 25 | .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-text-icon .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -9px; } |
26 | 26 | .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } |
27 | | -.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icon .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: 0; } |
28 | | -.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icon .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: 16px; } |
| 27 | +.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icon .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: 0.5em; } |
| 28 | +.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icon .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: 0.5em; } |
29 | 29 | |
30 | 30 | /*button sets*/ |
31 | 31 | .ui-buttonset { margin-right: 7px; } |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | body .ui-button { |
38 | 38 | -moz-border-radius: 4px; |
39 | 39 | -webkit-border-radius: 4px; |
40 | | - padding: 0.2em 0.6em 0.15em !important; |
| 40 | + border-radius: 4px; |
41 | 41 | margin: 0.5em 0 0.5em 0.4em !important; |
42 | 42 | border: 1px solid #a6a6a6 !important; |
43 | 43 | /* @embed */ |
Property changes on: branches/REL1_18/phase3 |
___________________________________________________________________ |
Modified: svn:mergeinfo |
44 | 44 | Merged /trunk/phase3:r92846,93065,93834,94171 |