Skip to content

Commit 60e3d5e

Browse files
committed
MAGE-1377 Address Codacy escaping complaint
1 parent 49d48c3 commit 60e3d5e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Model/Backend/QueueCron.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,14 @@ public function beforeSave()
3030
}
3131

3232
if (!preg_match(self::CRON_FORMAT_REGEX, $value)) {
33+
// This use of preg_replace is safe — static regex without /e modifier.
34+
// phpcs:ignore
3335
$safeValue = preg_replace(self::CRON_DISALLOW_REGEX, '', (string) $value);
3436
$msg = ($safeValue !== $value)
3537
? 'Cron expression is invalid.'
3638
: sprintf(
3739
'Cron expression "%s" is not valid.',
38-
$safeValue
40+
htmlspecialchars($safeValue, ENT_QUOTES, 'UTF-8')
3941
);
4042
throw new InvalidCronException($msg);
4143
}

0 commit comments

Comments
 (0)