Skip to content

Commit bf84fec

Browse files
author
Hayder Sharhan
committed
MAGETWO-48819: [GitHub #3233] Arbitrary PHP code execution in M2.0.2
- Fixed regex of static test.
1 parent dfa038a commit bf84fec

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

dev/tests/static/framework/Magento/Sniffs/Files/LineLengthSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ class LineLengthSniff extends \Generic_Sniffs_Files_LineLengthSniff
2222
*/
2323
protected function checkLineLength(\PHP_CodeSniffer_File $phpcsFile, $stackPtr, $lineContent)
2424
{
25-
$previousLineRegexp = '~__\($|Phrase\($~';
26-
$currentLineRegexp = '~__\(.+\)|Phrase\(.+\)~';
25+
$previousLineRegexp = '~__\($|\bPhrase\($~';
26+
$currentLineRegexp = '~__\(.+\)|\bPhrase\(.+\)~';
2727
$currentLineMatch = preg_match($currentLineRegexp, $lineContent) !== 0;
2828
$previousLineMatch = preg_match($previousLineRegexp, $this->previousLineContent) !== 0;
2929
$this->previousLineContent = $lineContent;

setup/src/Magento/Setup/Module/I18n/Dictionary/Phrase.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,12 +259,10 @@ public function getCompiledTranslation()
259259
}
260260

261261
/**
262-
* Compile PHP string based on quotes type it enclosed with
262+
* Compile PHP string (escaping unescaped quotes and processing concatenation)
263263
*
264264
* @param string $string
265265
* @return string
266-
*
267-
* @SuppressWarnings(PHPMD.EvalExpression)
268266
*/
269267
private function getCompiledString($string)
270268
{

0 commit comments

Comments
 (0)