← Back to team overview

mahara-contributors team mailing list archive

[Bug 1757330] Re: Export file Session Data not saved in PHP 7.1+

 

There seems to be some strangeness about keeping the session when
redirecting from the iframe in PHP 7.1

I've added a patch where we just pass part of the filepath info to the
print_export_footer() function (strip all up to the user's id number)

https://reviews.mahara.org/#/c/8712/1

And check on return if the logged in user can access the file based on
their user id

** Changed in: mahara
   Importance: Undecided => High

** Also affects: mahara/18.10
   Importance: Undecided
       Status: New

** Also affects: mahara/17.04
   Importance: Undecided
       Status: New

** Also affects: mahara/18.04
   Importance: High
       Status: New

** Also affects: mahara/17.10
   Importance: Undecided
       Status: New

** Changed in: mahara/17.10
   Importance: Undecided => High

** Changed in: mahara/17.04
   Importance: Undecided => High

** Changed in: mahara/18.10
   Importance: Undecided => High

** Changed in: mahara/18.10
    Milestone: None => 18.10.0

** Changed in: mahara/18.04
    Milestone: None => 18.04.0

** Changed in: mahara/17.10
    Milestone: None => 17.10.4

** Changed in: mahara/17.04
    Milestone: None => 17.04.7

** Changed in: mahara/18.10
       Status: New => In Progress

** Changed in: mahara/18.04
       Status: New => Confirmed

** Changed in: mahara/17.10
       Status: New => Confirmed

** Changed in: mahara/17.04
       Status: New => Confirmed

-- 
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:
  Confirmed
Status in Mahara 17.04 series:
  Confirmed
Status in Mahara 17.10 series:
  Confirmed
Status in Mahara 18.04 series:
  Confirmed
Status in Mahara 18.10 series:
  In Progress

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


References