fix: fix webp image covver

fix #234
pull/236/head
Spirit 2020-08-02 22:35:08 +08:00
parent 7a96dd7549
commit e15bbeb896
1 changed files with 1 additions and 1 deletions

View File

@ -154,7 +154,7 @@ class Images
$img_array = json_decode($sakura_image_array, true);
$img = array_rand($img_array);
$img_domain = akina_option('cover_cdn') ? akina_option('cover_cdn') : get_template_directory_uri();
if (strpos($_SERVER['HTTP_ACCEPT'], 'image/webp')) {
if (strpos($_SERVER['HTTP_ACCEPT'], 'image/webp') !== false) {
$imgurl = $img_domain . "/manifest/" . $img_array[$img]["webp"][0];
} else {
$imgurl = $img_domain . "/manifest/" . $img_array[$img]["jpeg"][0];