Skip to content
Snippets Groups Projects
Unverified Commit 5ecde6c8 authored by Chris Sangwin's avatar Chris Sangwin Committed by GitHub
Browse files

Merge pull request #1191 from AnupamaSarjoshi/wip788956

Add trim to fix filename path returned by zip::getNameIndex function
parents 04221616 7bb0e61d
No related branches found
No related tags found
No related merge requests found
......@@ -74,7 +74,8 @@ class stack_cas_connection_server extends stack_cas_connection_base {
$zip = new ZipArchive();
$zip->open($ziptemp);
for ($i = 0; $i < $zip->numFiles; $i++) {
$filenameinzip = $zip->getNameIndex($i);
// In some PHP versions, zip::getNameIndex returns filename with leading '/', hence trim.
$filenameinzip = trim($zip->getNameIndex($i), '/');
if ($filenameinzip === 'OUTPUT') {
// This one contains the output from maxima.
......
......@@ -99,7 +99,8 @@ class stack_cas_connection_server_proxy extends stack_cas_connection_base {
$zip = new ZipArchive();
$zip->open($ziptemp);
for ($i = 0; $i < $zip->numFiles; $i++) {
$filenameinzip = $zip->getNameIndex($i);
// In some PHP versions, zip::getNameIndex returns filename with leading '/', hence trim.
$filenameinzip = trim($zip->getNameIndex($i), '/');
if ($filenameinzip === 'OUTPUT') {
// This one contains the output from maxima.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment