Skip to content

Commit 759b2d7

Browse files
committed
PHP 8.0 > String to Number Comparison.
When $previousIndent was equal to 0, and $matches['indent'] = " " PHP(before 8.0)> (0 != " ") ==> false PHP8.0+ > (0 != " ") ==> true In order to keep "false" value we avoid "0" as a valid value. More details here why here: https://www.php.net/manual/en/migration80.incompatible.php
1 parent f19cc6e commit 759b2d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/yaml/sfYamlParser.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ protected function parseFoldedScalar($separator, $indicator = '', $indentation =
474474

475475
if (preg_match('#^(?P<indent> {'.strlen($textIndent).',})(?P<text>.+)$#u', $this->currentLine, $matches))
476476
{
477-
if (' ' == $separator && $previousIndent != $matches['indent'])
477+
if (' ' == $separator && ($previousIndent && $previousIndent != $matches['indent']))
478478
{
479479
$text = substr($text, 0, -1)."\n";
480480
}

0 commit comments

Comments
 (0)