Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix PHP 5.4 upload progress working only with session.upload_progress…

….cleanup set to Off
  • Loading branch information...
commit 5dc0f782f501ed011a918483e4e69085bff722b0 1 parent a042003
J.M authored
Showing with 11 additions and 2 deletions.
  1. +11 −2 import_status.php
13 import_status.php
View
@@ -25,12 +25,12 @@
) {
$sessionupload = array();
- $prefix = ini_get('session.upload_progress.prefix');
+ define('UPLOAD_PREFIX', ini_get('session.upload_progress.prefix'));
session_start();
foreach ($_SESSION as $key => $value) {
// only copy session-prefixed data
- if (substr($key, 0, strlen($prefix)) == $prefix) {
+ if (substr($key, 0, strlen(UPLOAD_PREFIX)) == UPLOAD_PREFIX) {
$sessionupload[$key] = $value;
}
}
@@ -54,6 +54,15 @@
foreach ($sessionupload as $key => $value) {
$_SESSION[$key] = $value;
}
+
+ // remove session upload data that are not set anymore
+ foreach ($_SESSION as $key => $value) {
+ if (substr($key, 0, strlen(UPLOAD_PREFIX)) == UPLOAD_PREFIX
+ && ! isset($sessionupload[$key])
+ ) {
+ unset($_SESSION[$key]);
+ }
+ }
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.