Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 1 changed file with 11 additions and 2 deletions. Show diff stats Hide diff stats

  1. +11 2 import_status.php
13 import_status.php
@@ -25,12 +25,12 @@
25 25 ) {
26 26
27 27 $sessionupload = array();
28   - $prefix = ini_get('session.upload_progress.prefix');
  28 + define('UPLOAD_PREFIX', ini_get('session.upload_progress.prefix'));
29 29
30 30 session_start();
31 31 foreach ($_SESSION as $key => $value) {
32 32 // only copy session-prefixed data
33   - if (substr($key, 0, strlen($prefix)) == $prefix) {
  33 + if (substr($key, 0, strlen(UPLOAD_PREFIX)) == UPLOAD_PREFIX) {
34 34 $sessionupload[$key] = $value;
35 35 }
36 36 }
@@ -54,6 +54,15 @@
54 54 foreach ($sessionupload as $key => $value) {
55 55 $_SESSION[$key] = $value;
56 56 }
  57 +
  58 + // remove session upload data that are not set anymore
  59 + foreach ($_SESSION as $key => $value) {
  60 + if (substr($key, 0, strlen(UPLOAD_PREFIX)) == UPLOAD_PREFIX
  61 + && ! isset($sessionupload[$key])
  62 + ) {
  63 + unset($_SESSION[$key]);
  64 + }
  65 + }
57 66 }
58 67
59 68 /**

0 comments on commit 5dc0f78

Please sign in to comment.
Something went wrong with that request. Please try again.