Check for index to exist before accessing it.
authorMukunda Modell <mmodell@wikimedia.org>
Wed, 10 May 2017 21:43:21 +0000 (16:43 -0500)
committer20after4 <mmodell@wikimedia.org>
Wed, 10 May 2017 22:26:27 +0000 (22:26 +0000)
This fixes "Notice: Undefined index: quality ..."

Bug: T164983
Change-Id: If72c40aeaf0ee5727e21f9fe4dac92c12436ce41

includes/media/Jpeg.php

index 5822699..29f0d7c 100644 (file)
@@ -205,7 +205,7 @@ class JpegHandler extends ExifBitmapHandler {
                        // we'll also add TinyRGB profile to images lacking a profile, but
                        // only if they're not low quality (which are meant to save bandwith
                        // and we don't want to increase the filesize by adding a profile)
-                       if ( $params['quality'] > 30 ) {
+                       if ( isset( $params['quality'] ) && $params['quality'] > 30 ) {
                                $profiles[] = '-';
                        }