Reviewed:  https://reviews.mahara.org/8731
Committed: 
https://git.mahara.org/mahara/mahara/commit/9f1f94ff48e7bb0dae798e7332951d862308b4a2
Submitter: Cecilia Vela Gurovic (cecili...@catalyst.net.nz)
Branch:    17.10_STABLE

commit 9f1f94ff48e7bb0dae798e7332951d862308b4a2
Author: Robert Lyon <robe...@catalyst.net.nz>
Date:   Mon Mar 26 09:49:17 2018 +1300

Bug 1757330: PHP 7.1 is not keeping the session when exporting

We do a bunch of iframe / js tricks to get the progress bar to work
and then rely on session for the file name to serve it at the end

This change just passes only the file name to the js redirect and then
rebuilds the full path on return. Because we use the user's id in full
path we can make sure only the valid logged in user can fetch the file

behatnotneeded

Change-Id: I6478df19465ad8e1075343cb40e6f5360061b56a
Signed-off-by: Robert Lyon <robe...@catalyst.net.nz>
(cherry picked from commit ba36e509d2958380f1957b97274391ef6b90f6c4)

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask 
on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1757330

Title:
  Export file Session Data not saved in PHP 7.1+

Status in Mahara:
  Fix Committed
Status in Mahara 17.04 series:
  Won't Fix
Status in Mahara 17.10 series:
  Fix Committed
Status in Mahara 18.04 series:
  Fix Committed
Status in Mahara 18.10 series:
  Fix Committed

Bug description:
  Mahara 17.10.3 (alo occurs on Mahara 17.10.0)
  Operating system: Ubuntu, apache2, PHP 7.1.8 (also occurs on PHP 7.1.15 and 
PHP 7.1.3)
  Database; MySQL
  Browser: Chrome.

  Exporting files in Mahara
  /export/index.php

  Export Either LEAP file or Standalone HTML
  click Generate Export
  in the iframe - the /export/download.php redirects back to the 
export/index.php file and nothing is downloaded - the progress iframe now shows 
the /export/index.php page.

  Possible Cause:
  Download.php (export/download.php) as this located at the bottom of the page 
(~ line 106)
  $SESSION->set('exportfile', $exporter->get('exportdir') . $zipfile);

  At the top of the page it checks to see if this session data exists - and if 
so - to force the download of the file.
  line 17: 
  if ($exportfile = $SESSION->get('exportfile')) {
      $SESSION->set('exportdata', '');
      $SESSION->set('exportfile', '');
      require_once('file.php');
      serve_file($exportfile, basename($exportfile), 'application/x-zip', 
array('lifetime' => 0, 'forcedownload' => true));
      exit;
  }

  In PHP 7.1.3 and higher - the $SESSION->get('exportfile') is empty
  when the JS redirect calls this page (from the print_export_footer
  function) and the session data set at the bottom of the page is not
  present when the page is being loaded to get the file. (loading the
  /export/index.php again will empty the exportfile data).

  The export works as expected in PHP 7, but fails in PHP 7.1+.

  Is Mahara 7.1+ ready?

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1757330/+subscriptions

_______________________________________________
Mailing list: https://launchpad.net/~mahara-contributors
Post to     : mahara-contributors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~mahara-contributors
More help   : https://help.launchpad.net/ListHelp

Reply via email to