Skip to content

Commit 3f47e27

Browse files
author
Samuel Akopyan
committed
Fixed curly braces in array to []
1 parent dc0721a commit 3f47e27

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

framework/helpers/CImage.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ public static function resizeImage($imagePath, $imageName, $resizeWidth = '', $r
8787
$imagePathNameNew = $imagePath . $imageName;
8888

8989
if ($case != '') {
90+
// Prevent using of size like 150px or something else
91+
$resizeWidth = intval($resizeWidth);
92+
$resizeHeight = intval($resizeHeight);
93+
9094
if ($resizeWidth != '' && $resizeHeight == '') {
9195
$newWidth = $resizeWidth;
9296
$newHeight = ($height / $width) * $newWidth;

framework/helpers/widgets/CDataForm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ public static function init($params = array())
354354
} elseif ($fieldType == 'image') {
355355
unset($recordsAssoc[$field]);
356356
} elseif ($fieldType == 'data') {
357-
$fieldValue = self::keyAt('default', $fieldInfo, '');
357+
$fieldValue = self::keyAt('default', $fieldInfo, null);
358358
} elseif ($fieldType == 'imageupload') {
359359
if (!empty($_FILES[$field]['name'])) {
360360
$targetPath = self::keyAt('validation.targetPath', $fieldInfo, '');

framework/helpers/widgets/CFormValidation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ private static function _validateMaxLength($fieldValue, $maxLength, $title, $msg
520520
}
521521
}
522522
} elseif (!CValidator::validateMaxLength($fieldValue, $maxLength)) {
523-
self::$_errorMessage = A::t($msgSource, 'The {title} field length may be {max_length} characters maximum! Please re-enter.', array('{title}' => $title, '{max_length}' => $maxLength));
523+
self::$_errorMessage = A::t($msgSource, 'The {title} field length may be {max_length} characters maximum! Please re-enter.', array('{title}' => $title, '{max_length}' => number_format($maxLength)));
524524
$result = false;
525525
}
526526

framework/helpers/widgets/CFormView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ private static function _formField($field, $fieldInfo, $events, $formName = '',
725725

726726
case 'textarea':
727727
$maxLength = (int)self::keyAt('maxLength', $htmlOptions, 0);
728-
if ($maxLength > 0) $appendLabel = '<br>' . A::t('core', 'max.: {maxchars} chars', array('{maxchars}' => $maxLength));
728+
if ($maxLength > 0) $appendLabel = '<br>' . A::t('core', 'max.: {maxchars} chars', array('{maxchars}' => number_format($maxLength)));
729729
$fieldHtml = CHtml::textArea($field, $value, $htmlOptions);
730730
break;
731731

0 commit comments

Comments
 (0)