comparison mgallery.inc.php @ 305:b816e80bc002

Add a check for that we are running on PHP 7.1 or later if WebP format images are being used.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 03 Apr 2020 16:25:00 +0300
parents 6bb434968623
children 2c5ff6aa9845
comparison
equal deleted inserted replaced
304:da150fe627b6 305:b816e80bc002
206 206
207 207
208 function mgGetAlbumSetting(&$data, $key, $default = NULL) 208 function mgGetAlbumSetting(&$data, $key, $default = NULL)
209 { 209 {
210 if (array_key_exists($key, $data)) 210 if (array_key_exists($key, $data))
211 return $data[$key]; 211 $val = $data[$key];
212 else 212 else
213 return mgGetSetting($key, $default); 213 $val = mgGetSetting($key, $default);
214
215 // XXX This is a rather silly place for this check, but since any album can
216 // set their own formats, we can't do this check globally without scanning
217 // all the sub-albums etc .. maybe we'll do that some day.
218 if (($key == "tn_format" || $key == "med_format") &&
219 $val == "webp" && version_compare(PHP_VERSION, "7.1.0") < 0)
220 {
221 die("ERROR: WEBP image format support requires PHP version 7.1 or later.");
222 }
223
224 return $val;
214 } 225 }
215 226
216 227
217 function mgGetPath($path, $key) 228 function mgGetPath($path, $key)
218 { 229 {