Browse Source
Merge pull request #12 from jmross/master
When parsing response with regex, check resulting array of matches be…
tags/0.9.1
Coder
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
src/Client.php
|
|
@ -240,7 +240,7 @@ class Client implements Interfaces\ClientInterface |
|
|
// If we have lines after current one
|
|
|
// If we have lines after current one
|
|
|
if (isset($response[$j])) { |
|
|
if (isset($response[$j])) { |
|
|
$this->pregResponse($response[$j], $matches); |
|
|
$this->pregResponse($response[$j], $matches); |
|
|
if (!empty($matches)) { |
|
|
|
|
|
|
|
|
if (isset($matches[1][0], $matches[2][0])) { |
|
|
$result['after'][$matches[1][0]] = $matches[2][0]; |
|
|
$result['after'][$matches[1][0]] = $matches[2][0]; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -248,7 +248,7 @@ class Client implements Interfaces\ClientInterface |
|
|
break 2; |
|
|
break 2; |
|
|
default: |
|
|
default: |
|
|
$this->pregResponse($value, $matches); |
|
|
$this->pregResponse($value, $matches); |
|
|
if (!empty($matches)) { |
|
|
|
|
|
|
|
|
if (isset($matches[1][0], $matches[2][0])) { |
|
|
$result[$i][$matches[1][0]] = $matches[2][0]; |
|
|
$result[$i][$matches[1][0]] = $matches[2][0]; |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
|