Index: branches/new-installer/phase3/maintenance/language/messages.inc |
— | — | @@ -3143,6 +3143,7 @@ |
3144 | 3144 | 'config-session-error', |
3145 | 3145 | 'config-session-expired', |
3146 | 3146 | 'config-no-session', |
| 3147 | + 'config-session-path-bad', |
3147 | 3148 | 'config-show-help', |
3148 | 3149 | 'config-hide-help', |
3149 | 3150 | 'config-your-language', |
Index: branches/new-installer/phase3/includes/installer/WebInstaller.php |
— | — | @@ -203,6 +203,11 @@ |
204 | 204 | * Start the PHP session. This may be called before execute() to start the PHP session. |
205 | 205 | */ |
206 | 206 | function startSession() { |
| 207 | + $sessPath = $this->getSessionSavePath(); |
| 208 | + if( !is_dir( $sessPath ) || !is_writeable( $sessPath ) ) { |
| 209 | + $this->showError( 'config-session-path-bad', $sessPath ); |
| 210 | + return false; |
| 211 | + } |
207 | 212 | if( wfIniGetBool( 'session.auto_start' ) || session_id() ) { |
208 | 213 | // Done already |
209 | 214 | return true; |
— | — | @@ -220,6 +225,21 @@ |
221 | 226 | } |
222 | 227 | |
223 | 228 | /** |
| 229 | + * Get the value of session.save_path |
| 230 | + * |
| 231 | + * Per http://www.php.net/manual/en/ref.session.php#ini.session.save-path, |
| 232 | + * this might have some additional preceding parts which need to be |
| 233 | + * ditched |
| 234 | + * |
| 235 | + * @return string |
| 236 | + */ |
| 237 | + private function getSessionSavePath() { |
| 238 | + $path = ini_get( 'session.save_path' ); |
| 239 | + $path = substr( $path, strrpos( $path, ';' ) ); |
| 240 | + return $path; |
| 241 | + } |
| 242 | + |
| 243 | + /** |
224 | 244 | * Show an error message in a box. Parameters are like wfMsg(). |
225 | 245 | */ |
226 | 246 | function showError( $msg /*...*/ ) { |
Index: branches/new-installer/phase3/languages/messages/MessagesEn.php |
— | — | @@ -4127,6 +4127,7 @@ |
4128 | 4128 | Please restart the installation process.', |
4129 | 4129 | 'config-no-session' => 'Your session data was lost! |
4130 | 4130 | Please check your php.ini and make sure session.save_path is set to an appropriate directory.', |
| 4131 | +'config-session-path-bad' => 'Your session.save_path ($1) seems to be invalid or unwritable.', |
4131 | 4132 | 'config-show-help' => 'Help', |
4132 | 4133 | 'config-hide-help' => 'Hide help', |
4133 | 4134 | 'config-your-language' => 'Your language:', |