* (bug 9820) session.save_path check no longer halts installation, but warns of possi...
authorRob Church <robchurch@users.mediawiki.org>
Tue, 5 Jun 2007 00:20:56 +0000 (00:20 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Tue, 5 Jun 2007 00:20:56 +0000 (00:20 +0000)
* (bug 9978) Fixed session.save_path validation when using extended configuration format, e.g. "5;/tmp"

RELEASE-NOTES
config/index.php
install-utils.inc

index b3d8a8b..a4f08c2 100644 (file)
@@ -114,6 +114,10 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 10118) Introduced Special:Mostlinkedtemplates, report which lists
   templates with a high number of inclusion links
 * (bug 10104) Fixed Database::getLag() for PostgreSQL and Oracle
+* (bug 9820) session.save_path check no longer halts installation, but
+  warns of possible bad values
+* (bug 9978) Fixed session.save_path validation when using extended
+  configuration format, e.g. "5;/tmp"
 
 == MediaWiki API changes since 1.10 ==
 
index 75db7d0..0f762f4 100644 (file)
@@ -395,7 +395,8 @@ if( !function_exists( 'session_name' ) )
 
 # session.save_path doesn't *have* to be set, but if it is, and it's
 # not valid/writable/etc. then it can cause problems
-$sessionSavePath = ini_get( 'session.save_path' );
+$sessionSavePath = mw_get_session_save_path();
+$ssp = htmlspecialchars( $sessionSavePath );
 # Warn the user if it's not set, but let them proceed
 if( !$sessionSavePath ) {
        print "<li><strong>Warning:</strong> A value for <tt>session.save_path</tt>
@@ -404,14 +405,12 @@ if( !$sessionSavePath ) {
        for the user your web server is running under.</li>";
 } elseif ( is_dir( $sessionSavePath ) && is_writable( $sessionSavePath ) ) {
        # All good? Let the user know
-       print "<li>Session save path appears to be valid.</li>";
+       print "<li>Session save path (<tt>{$ssp}</tt>) appears to be valid.</li>";
 } else {
-       # Something not right? Halt the installation so the user can fix it up
-       dieout( "Your session save path appears to be invalid or is not writable.
-               PHP needs to be able to save data to this location in order for correct
-               session operation. Please check that <tt>session.save_path</tt> in
-               <tt>PHP.ini</tt> points to a valid path, and is read/write/execute for
-               the user your web server is running under." );
+       # Something not right? Warn the user, but let them proceed
+       print "<li><strong>Warning:</strong> Your <tt>session.save_path</tt> value (<tt>{$ssp}</tt>)
+               appears to be invalid or is not writable. PHP needs to be able to save data to
+               this location for correct session operation.</li>";
 }
 
 # Check for PCRE support
index 4e1aad2..24480f9 100644 (file)
@@ -106,4 +106,20 @@ function dbsource( $fname, $db = false ) {
                exit(1);
        }
 }
-?>
+
+/**
+ * Get the value of session.save_path
+ *
+ * Per http://uk.php.net/manual/en/ref.session.php#ini.session.save-path,
+ * this might have some additional preceding parts which need to be
+ * ditched
+ *
+ * @return string
+ */
+function mw_get_session_save_path() {
+       $path = ini_get( 'session.save_path' );
+       $path = substr( $path, strrpos( $path, ';' ) );
+       return $path;
+}
+
+?>
\ No newline at end of file