mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fix function stream_wrapper_restore not found
This commit is contained in:
parent
7e858125fb
commit
93bbd6770e
|
|
@ -56,13 +56,17 @@ class DolGeoIP
|
|||
if ($type == 'country') {
|
||||
// geoip may have been already included with PEAR
|
||||
if ($geoipversion == '2' || ($geoipversion != 'php' && !function_exists('geoip_country_code_by_name'))) {
|
||||
stream_wrapper_restore('phar');
|
||||
if (function_exists('stream_wrapper_restore')) {
|
||||
stream_wrapper_restore('phar');
|
||||
}
|
||||
require_once DOL_DOCUMENT_ROOT.'/includes/geoip2/geoip2.phar';
|
||||
}
|
||||
} elseif ($type == 'city') {
|
||||
// geoip may have been already included with PEAR
|
||||
if ($geoipversion == '2' || ($geoipversion != 'php' && !function_exists('geoip_country_code_by_name'))) {
|
||||
stream_wrapper_restore('phar');
|
||||
if (function_exists('stream_wrapper_restore')) {
|
||||
stream_wrapper_restore('phar');
|
||||
}
|
||||
require_once DOL_DOCUMENT_ROOT.'/includes/geoip2/geoip2.phar';
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ $result = @include_once $conffile; // Keep @ because with some error reporting t
|
|||
|
||||
// Disable some not used PHP stream
|
||||
$listofwrappers = stream_get_wrappers();
|
||||
// We need '.phar' for geoip2. TODO Replace phar with explode files so we can disable phar.
|
||||
// We need '.phar' for geoip2. TODO Replace phar in geoip with exploded files so we can disable phar.
|
||||
$arrayofstreamtodisable = array('compress.zlib', 'compress.bzip2', 'ftps', 'glob', 'data', 'expect', 'ftp', 'ogg', 'rar', 'zip', 'zlib');
|
||||
foreach ($arrayofstreamtodisable as $streamtodisable) {
|
||||
if (!empty($listofwrappers) && in_array($streamtodisable, $listofwrappers)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user