Commit 90432995 authored by lphuberdeau's avatar lphuberdeau

[FIX] Some pieces not quite behaving as expected

parent 234d5684
......@@ -29,13 +29,13 @@ class AuthTokens
return null;
}
$registered = json_decode( $data['parameters'], true );
$registered = (array) json_decode( $data['parameters'], true );
if( ! $this->allPresent( $registered, $parameters )
|| ! $this->allPresent( $parameters, $registered ) ) {
return null;
}
return json_decode( $data['groups'], true );
return (array) json_decode( $data['groups'], true );
}
private function allPresent( $a, $b ) {
......
......@@ -39,9 +39,10 @@ function wikiplugin_archivebuilder( $data, $params ) {
$handler = array_shift( $parts );
if( isset( $handlers[$handler] ) ) {
$files = call_user_func_array( $handlers[$handler], $parts );
foreach( $files as $name => $content ) {
$result = call_user_func_array( $handlers[$handler], $parts );
foreach( $result as $name => $content ) {
$archive->addFromString( $name, $content );
$files[] = $name;
}
}
}
......@@ -50,7 +51,9 @@ function wikiplugin_archivebuilder( $data, $params ) {
$archive->close();
header( 'Content-Type: application/zip' );
header( "Content-Disposition: attachment;filename={$params['name']}" );
header( "Content-Disposition: attachment; filename=\"{$params['name']}\"" );
header( 'Content-Transfer-Encoding: binary' );
header( 'Content-Length: ' . filesize( $file ) . '; filename="' . $params['name'] . '"' );
readfile( $file );
unlink( $file );
die;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment