r23684 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23683‎ | r23684 | r23685 >
Date:20:33, 3 July 2007
Author:brion
Status:old
Tags:
Comment:
Backport r22729 from trunk -- improve compatibility with some weird PHP session save paths.
Modified paths:
  • /branches/REL1_10/phase3/RELEASE-NOTES (modified) (history)
  • /branches/REL1_10/phase3/config/index.php (modified) (history)
  • /branches/REL1_10/phase3/install-utils.inc (modified) (history)

Diff [purge]

Index: branches/REL1_10/phase3/config/index.php
@@ -395,7 +395,8 @@
396396
397397 # session.save_path doesn't *have* to be set, but if it is, and it's
398398 # not valid/writable/etc. then it can cause problems
399 -$sessionSavePath = ini_get( 'session.save_path' );
 399+$sessionSavePath = mw_get_session_save_path();
 400+$ssp = htmlspecialchars( $sessionSavePath );
400401 # Warn the user if it's not set, but let them proceed
401402 if( !$sessionSavePath ) {
402403 print "<li><strong>Warning:</strong> A value for <tt>session.save_path</tt>
@@ -404,14 +405,12 @@
405406 for the user your web server is running under.</li>";
406407 } elseif ( is_dir( $sessionSavePath ) && is_writable( $sessionSavePath ) ) {
407408 # All good? Let the user know
408 - print "<li>Session save path appears to be valid.</li>";
 409+ print "<li>Session save path (<tt>{$ssp}</tt>) appears to be valid.</li>";
409410 } else {
410 - # Something not right? Halt the installation so the user can fix it up
411 - dieout( "Your session save path appears to be invalid or is not writable.
412 - PHP needs to be able to save data to this location in order for correct
413 - session operation. Please check that <tt>session.save_path</tt> in
414 - <tt>PHP.ini</tt> points to a valid path, and is read/write/execute for
415 - the user your web server is running under." );
 411+ # Something not right? Warn the user, but let them proceed
 412+ print "<li><strong>Warning:</strong> Your <tt>session.save_path</tt> value (<tt>{$ssp}</tt>)
 413+ appears to be invalid or is not writable. PHP needs to be able to save data to
 414+ this location for correct session operation.</li>";
416415 }
417416
418417 # Check for PCRE support
Index: branches/REL1_10/phase3/RELEASE-NOTES
@@ -5,8 +5,12 @@
66
77 == MediaWiki 1.10.1 ==
88
9 -??, 2007
 9+July ??, 2007
1010
 11+This is a bugfix update to the Spring 2007 quarterly release snapshot.
 12+A number of fixes to improve compatibility with PostgreSQL, some versions
 13+of MySQL, and some PHP configurations are included.
 14+
1115 * (bug 9417) Uploading new versions of images when using Postgres no longer
1216 throws warnings.
1317 * (bug 9908) Using tsearch2 with Postgres 8.1 no longer gives an error.
@@ -15,6 +19,10 @@
1620 * Fixed installation on MyISAM or old InnoDB with charset=utf8, was giving
1721 overlong key errors.
1822 * Fixed zero-padding issues with MySQL 5 binary schema
 23+* (bug 9820) session.save_path check no longer halts installation, but
 24+ warns of possible bad values
 25+* (bug 9978) Fixed session.save_path validation when using extended
 26+ configuration format, e.g. "5;/tmp"
1927
2028 == MediaWiki 1.10.0 ==
2129
Index: branches/REL1_10/phase3/install-utils.inc
@@ -106,4 +106,20 @@
107107 exit(1);
108108 }
109109 }
110 -?>
 110+
 111+/**
 112+ * Get the value of session.save_path
 113+ *
 114+ * Per http://uk.php.net/manual/en/ref.session.php#ini.session.save-path,
 115+ * this might have some additional preceding parts which need to be
 116+ * ditched
 117+ *
 118+ * @return string
 119+ */
 120+function mw_get_session_save_path() {
 121+ $path = ini_get( 'session.save_path' );
 122+ $path = substr( $path, strrpos( $path, ';' ) );
 123+ return $path;
 124+}
 125+
 126+?>
\ No newline at end of file

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r22729* (bug 9820) session.save_path check no longer halts installation, but warns ...robchurch00:20, 5 June 2007

Status & tagging log