Skip to content

Commit

Permalink
Use stripos() instead of strpos() when looking for 'timeout' in error
Browse files Browse the repository at this point in the history
  • Loading branch information
raamdev committed Dec 31, 2015
1 parent 0655c41 commit e97fb31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/includes/closures/Plugin/AutoCacheUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@

if (is_wp_error($head = wp_remote_head($sitemap, array('redirection' => 5)))) {
$failure = 'WP_Http says: '.$head->get_error_message().'.';
if(strpos($head->get_error_message(), 'timed out') !== false || strpos($head->get_error_message(), 'timeout') !== false) { // $head->get_error_code() only returns generic `http_request_failed`
if(stripos($head->get_error_message(), 'timed out') !== false || stripos($head->get_error_message(), 'timeout') !== false) { // $head->get_error_code() only returns generic `http_request_failed`
$failure .= '<br /><em>'.__('Note: Most timeout errors are resolved by refreshing the page and trying again. If timeout errors persist, please see <a href="http://zencache.com/r/kb-article-why-am-i-seeing-a-timeout-error/" target="_blank">this article</a>.', SLUG_TD).'</em>';
}
} elseif (empty($head['response']['code']) || (int)$head['response']['code'] >= 400) {
Expand Down

0 comments on commit e97fb31

Please sign in to comment.