Changeset 626


Ignore:
Timestamp:
May 13, 2018 6:11:10 AM (6 years ago)
Author:
anonymous
Message:

Fix setSpec validation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/ImageThumb.inc.php

    r502 r626  
    222222            }
    223223        }
    224         if (!isset($spec['width']) || !is_int($spec['width'])) {
    225             $app->logMsg('setSpec error: width not specified.', LOG_ERR, __FILE__, __LINE__);
    226         }
    227         if (!isset($spec['height']) || !is_int($spec['height'])) {
    228             $app->logMsg('setSpec error: height not specified.', LOG_ERR, __FILE__, __LINE__);
     224        if (IMAGETHUMB_FIT_HEIGHT != $spec['scaling_type'] && (!isset($spec['width']) || !is_numeric($spec['width']))) {
     225            $app->logMsg(sprintf('setSpec error: invalid width: %s', $spec['width']), LOG_ERR, __FILE__, __LINE__);
     226        }
     227        if (IMAGETHUMB_FIT_WIDTH != $spec['scaling_type'] && (!isset($spec['height']) || !is_numeric($spec['height']))) {
     228            $app->logMsg(sprintf('setSpec error: invalid height: %s', $spec['height']), LOG_ERR, __FILE__, __LINE__);
    229229        }
    230230        if (isset($spec['quality']) && IMG_JPG != $spec['dest_file_type']) {
    231             $app->logMsg('The "quality" specification is not used unless IMG_JPG is the dest_file_type.', LOG_INFO, __FILE__, __LINE__);
     231            $app->logMsg('The "quality" specification is not used unless IMG_JPG is the dest_file_type.', LOG_NOTICE, __FILE__, __LINE__);
    232232        }
    233233        if (isset($spec['progressive']) && IMG_JPG != $spec['dest_file_type']) {
    234             $app->logMsg('The "progressive" specification is not used unless IMG_JPG is the dest_file_type.', LOG_INFO, __FILE__, __LINE__);
     234            $app->logMsg('The "progressive" specification is not used unless IMG_JPG is the dest_file_type.', LOG_NOTICE, __FILE__, __LINE__);
    235235        }
    236236
Note: See TracChangeset for help on using the changeset viewer.