| @@ -54,8 +54,9 @@ | ||
| 54 | 54 | |
| 55 | 55 | while ( $this->pos <= $this->max && ( $one = $this->string[ $this->pos++ ] ) !== $char ) { |
| 56 | 56 | $value .= $one; |
| 57 | 57 | } |
| 58 | + | |
| 58 | 59 | return $value; |
| 59 | 60 | } |
| 60 | 61 | |
| 61 | 62 | /** |
| @@ -83,9 +84,9 @@ | ||
| 83 | 84 | * abc => abc |
| 84 | 85 | * "abc" => abc |
| 85 | 86 | * ""abc"" => "abc" |
| 86 | 87 | */ |
| 87 | - if ( strlen( $value ) < 2 || substr( $value, 0, 1 ) !== '"' || substr( $value, -1, 1 ) !== '"' ) { | |
| 88 | + if ( strlen( $value ) < 2 || ! str_starts_with( $value, '"' ) || ! str_ends_with( $value, '"' ) ) { | |
| 88 | 89 | // Only remove exactly one quote from the start and the end and then only if there is one at each end. |
| 89 | 90 | // Too short, or does not start or end with a quote. |
| 90 | 91 | return $value; |
| 91 | 92 | } |