r75256 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75255‎ | r75256 | r75257 >
Date:16:02, 23 October 2010
Author:demon
Status:reverted (Comments)
Tags:
Comment:
Fix r63813, r64717 (session path detection in new installer). Surprise surprise, the PHP documentation doesn't match what happens in practice :p
Modified paths:
  • /trunk/phase3/includes/installer/WebInstaller.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/WebInstaller.php
@@ -308,16 +308,17 @@
309309 * Get the value of session.save_path
310310 *
311311 * Per http://www.php.net/manual/en/session.configuration.php#ini.session.save-path,
312 - * this might have some additional preceding parts which need to be
313 - * ditched
 312+ * this may have an initial integer value to indicate the depth of session
 313+ * storage (eg /tmp/a/b/c). Explode on ; and check and see if this part is
 314+ * there or not. Should also allow paths with semicolons in them (if you
 315+ * really wanted your session files stored in /tmp/some;dir) which PHP
 316+ * supposedly supports.
314317 *
315318 * @return String
316319 */
317320 private function getSessionSavePath() {
318 - $path = ini_get( 'session.save_path' );
319 - $path = ltrim( substr( $path, strrpos( $path, ';' ) ), ';');
320 -
321 - return $path;
 321+ $parts = explode( ';', ini_get( 'session.save_path' ), 2 );
 322+ return count( $parts ) == 1 ? $parts[0] : $parts[1];
322323 }
323324
324325 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r78259Remove bogus session_path checks. Reverts r67465, r63813, r75256, r64717.demon17:25, 12 December 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r63813Show an error if session.save_path is broken. Of course if session.auto_start...demon12:10, 16 March 2010
r64717session path extraction fixedfreakolowsky19:06, 7 April 2010

Comments

#Comment by Catrope (talk | contribs)   16:27, 12 December 2010

Ahhh, how does this work exactly? You're always trimming the part before the semicolon if present; this seems to contradict the assertion that it'll work with /tmp/some;dir

Status & tagging log