r22729 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22728‎ | r22729 | r22730 >
Date:00:20, 5 June 2007
Author:robchurch
Status:old
Tags:
Comment:
* (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"
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/config/index.php (modified) (history)
  • /trunk/phase3/install-utils.inc (modified) (history)

Diff [purge]

Index: trunk/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
Index: trunk/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: trunk/phase3/RELEASE-NOTES
@@ -114,6 +114,10 @@
115115 * (bug 10118) Introduced Special:Mostlinkedtemplates, report which lists
116116 templates with a high number of inclusion links
117117 * (bug 10104) Fixed Database::getLag() for PostgreSQL and Oracle
 118+* (bug 9820) session.save_path check no longer halts installation, but
 119+ warns of possible bad values
 120+* (bug 9978) Fixed session.save_path validation when using extended
 121+ configuration format, e.g. "5;/tmp"
118122
119123 == MediaWiki API changes since 1.10 ==
120124

Follow-up revisions

RevisionCommit summaryAuthorDate
r22747Merged revisions 22716-22746 via svnmerge from...david07:07, 5 June 2007
r23684Backport r22729 from trunk -- improve compatibility with some weird PHP sessi...brion20:33, 3 July 2007

Status & tagging log