mirror of
https://github.com/getgrav/grav.git
synced 2025-02-20 19:56:53 +01:00
Fixed predefined option in the decoding attribute
This commit is contained in:
parent
5d3407a192
commit
ccdf3e7190
|
|
@ -25,17 +25,16 @@ trait ImageDecodingTrait
|
|||
*/
|
||||
public function decoding($value = null)
|
||||
{
|
||||
$validValues = ['sync', 'async', 'auto'];
|
||||
|
||||
if (null === $value) {
|
||||
$value = Grav::instance()['config']->get('system.images.defaults.decoding', 'auto');
|
||||
}
|
||||
|
||||
// Validate the provided value
|
||||
if ($value && in_array($value, $validValues, true)) {
|
||||
// Validate the provided value (similar to loading)
|
||||
if ($value !== null && $value !== 'auto') {
|
||||
$this->attributes['decoding'] = $value;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user