From 93f177a3967bcf93286c032b3d28002855252f34 Mon Sep 17 00:00:00 2001 From: Fonata Date: Sat, 17 Mar 2018 12:17:25 +0100 Subject: [PATCH] Merged two ifs in _validate_row_condition to prevent This is to a sane count of zero PhpStorm inspections. In particular, this is NestedPositiveIfStatementsInspection from EA Extended. --- src/Csv.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/Csv.php b/src/Csv.php index 5c691e7..6a97509 100644 --- a/src/Csv.php +++ b/src/Csv.php @@ -1017,16 +1017,14 @@ class Csv { $op = $capture[2]; $value = $capture[3]; - if (preg_match('/^([\'\"]{1})(.*)([\'\"]{1})$/', $value, $capture)) { - if ($capture[1] == $capture[3]) { - $value = strtr($capture[2], array( - "\\n" => "\n", - "\\r" => "\r", - "\\t" => "\t", - )); + if (preg_match('/^([\'\"]{1})(.*)([\'\"]{1})$/', $value, $capture) && $capture[1] == $capture[3]) { + $value = strtr($capture[2], array( + "\\n" => "\n", + "\\r" => "\r", + "\\t" => "\t", + )); - $value = stripslashes($value); - } + $value = stripslashes($value); } if (array_key_exists($field, $row)) {