1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-28 08:39:57 +02:00

Issue #4270 Added .webp browser-support detection. Media-Manager "Convert to webp during render" can now be safely enabled and will temporarily fallback to the regular image if the browser does not support webp images.

This commit is contained in:
Cameron
2021-06-18 08:43:53 -07:00
parent a89b58a8a2
commit 7302803a75
3 changed files with 19 additions and 8 deletions

View File

@@ -419,7 +419,7 @@ $sysprefs = new prefs;
//DEPRECATED, BC, call e107::getPref/findPref() instead
if(e_ADMIN_AREA !== true && !isset($_E107['no_parser']) && !empty($pref['thumb_to_webp']))
if(e_ADMIN_AREA !== true && !isset($_E107['no_parser']) && !empty($pref['thumb_to_webp']) && (strpos( $_SERVER['HTTP_ACCEPT'], 'image/webp' ) !== false))
{
$tp->setConvertToWebP(true);
}