Page MenuHomePhorge

D25142.1734845485.diff
No OneTemporary

D25142.1734845485.diff

diff --git a/externals/pear-figlet/Text/Figlet.php b/externals/pear-figlet/Text/Figlet.php
--- a/externals/pear-figlet/Text/Figlet.php
+++ b/externals/pear-figlet/Text/Figlet.php
@@ -140,20 +140,23 @@
if (!$compressed) {
/* ZIPed font */
if (fread($fp, 2) == 'PK') {
- if (!function_exists('zip_open')) {
- return self::raiseError('Cannot load ZIP compressed fonts since'
- . ' ZIP PHP extension is not available.',
- 5);
- }
-
fclose($fp);
- if (!($fp = zip_open($filename))) {
- return self::raiseError('Cannot open figlet font file ' . $filename, 2);
+ $zip = new ZipArchive();
+
+ $zip_flags = 0;
+ if(defined('ZipArchive::RDONLY')) {
+ $zip_flags = ZipArchive::RDONLY; // Flag available since PHP 7.4, unnecessary before
+ }
+
+ $open_result = $zip->open($filename, $zip_flags);
+ if ($open_result !== true) {
+ return self::raiseError('Cannot open figlet font file ' .
+ $filename . ', got error: ' . $open_result, 2);
}
- $name = zip_entry_name(zip_read($fp));
- zip_close($fp);
+ $name = $zip->getNameIndex(0);
+ $zip->close();
if (!($fp = fopen('zip://' . realpath($filename) . '#' . $name, 'rb'))) {
return self::raiseError('Cannot open figlet font file ' . $filename, 2);
diff --git a/src/docs/user/installation_guide.diviner b/src/docs/user/installation_guide.diviner
--- a/src/docs/user/installation_guide.diviner
+++ b/src/docs/user/installation_guide.diviner
@@ -124,7 +124,7 @@
- PHP (usually "php")
- Required PHP extensions: mbstring, iconv, mysql (or mysqli), curl, pcntl
(these might be something like "php-mysql" or "php5-mysqlnd")
- - Optional PHP extensions: gd
+ - Optional PHP extensions: gd, zip
If you already have LAMP setup, you've probably already got everything you need.
It may also be helpful to refer to the install scripts above, even if they don't

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 22, 05:31 (17 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1025386
Default Alt Text
D25142.1734845485.diff (2 KB)

Event Timeline