[9.1.12] free image map erreur
This commit is contained in:
parent
50026f9092
commit
59fde383f0
@ -32,7 +32,7 @@ class common {
|
|||||||
const TEMP_DIR = 'site/tmp/';
|
const TEMP_DIR = 'site/tmp/';
|
||||||
|
|
||||||
// Numéro de version
|
// Numéro de version
|
||||||
const ZWII_VERSION = '9.1.11';
|
const ZWII_VERSION = '9.1.12';
|
||||||
|
|
||||||
public static $actions = [];
|
public static $actions = [];
|
||||||
public static $coreModuleIds = [
|
public static $coreModuleIds = [
|
||||||
@ -349,13 +349,15 @@ class common {
|
|||||||
if (!file_exists(self::FILE_DIR.'source/screenshot.png'))
|
if (!file_exists(self::FILE_DIR.'source/screenshot.png'))
|
||||||
{
|
{
|
||||||
if ( strpos(helper::baseUrl(false),'localhost') == 0 AND strpos(helper::baseUrl(false),'127.0.0.1') == 0) {
|
if ( strpos(helper::baseUrl(false),'localhost') == 0 AND strpos(helper::baseUrl(false),'127.0.0.1') == 0) {
|
||||||
$googlePagespeedData = file_get_contents('https://www.googleapis.com/pagespeedonline/v2/runPagespeed?url='. helper::baseUrl(false) .'&screenshot=true');
|
$googlePagespeedData = @file_get_contents('https://www.googleapis.com/pagespeedonline/v2/runPagespeed?url='. helper::baseUrl(false) .'&screenshot=true');
|
||||||
$googlePagespeedData = json_decode($googlePagespeedData, true);
|
if ($googlePagespeedData !== false) {
|
||||||
$screenshot = $googlePagespeedData['screenshot']['data'];
|
$googlePagespeedData = json_decode($googlePagespeedData, true);
|
||||||
$screenshot = str_replace(array('_','-'),array('/','+'),$screenshot);
|
$screenshot = $googlePagespeedData['screenshot']['data'];
|
||||||
$data = 'data:image/jpeg;base64,'.$screenshot;
|
$screenshot = str_replace(array('_','-'),array('/','+'),$screenshot);
|
||||||
$data = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $data));
|
$data = 'data:image/jpeg;base64,'.$screenshot;
|
||||||
file_put_contents( self::FILE_DIR.'source/screenshot.png',$data);
|
$data = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $data));
|
||||||
|
file_put_contents( self::FILE_DIR.'source/screenshot.png',$data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -231,19 +231,25 @@ class config extends common {
|
|||||||
$site = 'https://zwiicms.com/'; } else {
|
$site = 'https://zwiicms.com/'; } else {
|
||||||
$site = helper::baseUrl(false); }
|
$site = helper::baseUrl(false); }
|
||||||
|
|
||||||
$googlePagespeedData = file_get_contents('https://www.googleapis.com/pagespeedonline/v2/runPagespeed?url='. $site .'&screenshot=true');
|
$success= false;
|
||||||
$googlePagespeedData = json_decode($googlePagespeedData, true);
|
$googlePagespeedData = @file_get_contents('https://www.googleapis.com/pagespeedonline/v2/runPagespeed?url='. $site .'&screenshot=true');
|
||||||
$screenshot = $googlePagespeedData['screenshot']['data'];
|
if ($googlePagespeedData !== false) {
|
||||||
$screenshot = str_replace(array('_','-'),array('/','+'),$screenshot);
|
$googlePagespeedData = json_decode($googlePagespeedData, true);
|
||||||
$data = 'data:image/jpeg;base64,'.$screenshot;
|
$screenshot = $googlePagespeedData['screenshot']['data'];
|
||||||
$data = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $data));
|
$screenshot = str_replace(array('_','-'),array('/','+'),$screenshot);
|
||||||
file_put_contents( self::FILE_DIR.'source/screenshot.png',$data);
|
$data = 'data:image/jpeg;base64,'.$screenshot;
|
||||||
|
$data = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $data));
|
||||||
|
// Effacer la miniature
|
||||||
|
unlink (self::FILE_DIR.'thumb/screenshot.png');
|
||||||
|
file_put_contents( self::FILE_DIR.'source/screenshot.png',$data);
|
||||||
|
$success =true;
|
||||||
|
}
|
||||||
|
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'notification' => 'Image tag réinitialisée',
|
'notification' => $success === true ? 'Image tag réinitialisée' : "Erreur : image tag non créée",
|
||||||
'redirect' => helper::baseUrl() . 'config',
|
'redirect' => helper::baseUrl() . 'config',
|
||||||
'state' => true
|
'state' => $success
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user