Page MenuHomePhorge

D25142.1734688277.diff
No OneTemporary

D25142.1734688277.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);
@@ -231,7 +234,7 @@
$i = hexdec(substr($i, 2));
} else {
// If octal
- if ($i{0} === '0' && $i !== '0' || substr($i, 0, 2) == '-0') {
+ if ($i[0] === '0' && $i !== '0' || substr($i, 0, 2) == '-0') {
$i = octdec($i);
}
}
@@ -274,7 +277,7 @@
$lt = hexdec(substr($str, $i+2, 4));
$i += 5;
} else {
- $lt = ord($str{$i});
+ $lt = ord($str[$i]);
}
$hb = preg_quote($this->hardblank, '/');
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
@@ -121,7 +121,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
Fri, Dec 20, 09:51 (21 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1017244
Default Alt Text
D25142.1734688277.diff (2 KB)

Event Timeline