Browse Source

Fix export CSS to zip

Julio Montoya 5 years ago
parent
commit
bbbef59e85
1 changed files with 1 additions and 1 deletions
  1. 1 1
      main/admin/settings.lib.php

+ 1 - 1
main/admin/settings.lib.php

@@ -1902,7 +1902,7 @@ function generateCSSDownloadLink($style)
     if (is_dir($dir) && $check) {
         $zip = new PclZip($arch);
         // Remove path prefix except the style name and put file on disk
-        $zip->create($dir, PCLZIP_OPT_REMOVE_PATH, substr($dir, 0, -strlen($style)));
+        $zip->create($dir, PCLZIP_OPT_REMOVE_PATH, dirname($dir));
         $url = api_get_path(WEB_CODE_PATH).'course_info/download.php?archive_path=&archive='.str_replace(api_get_path(SYS_ARCHIVE_PATH), '', $arch);
 
         //@TODO: use more generic script to download.