Merge pull request #207 from loran750/patch-1
If pattern is set up, you cannot catch server problems
This commit is contained in:
commit
b1647d2c3f
|
@ -191,7 +191,7 @@ class StatusUpdater {
|
||||||
|
|
||||||
if(empty($code_matches[0])) {
|
if(empty($code_matches[0])) {
|
||||||
// somehow we dont have a proper response.
|
// somehow we dont have a proper response.
|
||||||
$this->error = 'no response from server';
|
$this->error = 'TIMEOUT ERROR: no response from server';
|
||||||
$result = false;
|
$result = false;
|
||||||
} else {
|
} else {
|
||||||
$code = $code_matches[1][0];
|
$code = $code_matches[1][0];
|
||||||
|
@ -199,17 +199,19 @@ class StatusUpdater {
|
||||||
|
|
||||||
// All status codes starting with a 4 or higher mean trouble!
|
// All status codes starting with a 4 or higher mean trouble!
|
||||||
if(substr($code, 0, 1) >= '4') {
|
if(substr($code, 0, 1) >= '4') {
|
||||||
$this->error = $code . ' ' . $msg;
|
$this->error = "HTTP STATUS ERROR: ".$code . ' ' . $msg;
|
||||||
$result = false;
|
$result = false;
|
||||||
} else {
|
} else {
|
||||||
$result = true;
|
$result = true;
|
||||||
}
|
|
||||||
}
|
//Okay, the HTTP status is good : 2xx or 3xx. Now we have to test the pattern if it's set up
|
||||||
if($this->server['pattern'] != '') {
|
if($this->server['pattern'] != '') {
|
||||||
// Check to see if the pattern was found.
|
// Check to see if the pattern was found.
|
||||||
if(!preg_match("/{$this->server['pattern']}/i", $curl_result)) {
|
if(!preg_match("/{$this->server['pattern']}/i", $curl_result)) {
|
||||||
$this->error = 'Pattern not found.';
|
$this->error = 'TEXT ERROR : Pattern not found.';
|
||||||
$result = false;
|
$result = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue