aboutsummaryrefslogtreecommitdiffstats
path: root/tools/init.php
diff options
context:
space:
mode:
Diffstat (limited to 'tools/init.php')
-rw-r--r--tools/init.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/init.php b/tools/init.php
index ce87fd8..4a0da64 100644
--- a/tools/init.php
+++ b/tools/init.php
@@ -39,11 +39,14 @@ function video_exists( $url ) {
$result = FALSE;
- foreach ( $headers as $hdr ) {
- if ( preg_match( '/^HTTP\/\d\.\d\s+(403)/', $hdr ) ) {
- $result = TRUE; // Found 403 Error
+ if (is_array($headers) || is_object($headers)) {
+ foreach ( $headers as $hdr ) {
+ if ( preg_match( '/^HTTP\/\d\.\d\s+(403|404)/', $hdr ) ) {
+ $result = TRUE; // Found 403 Error
+ }
}
}
+
if ( $result === TRUE ) {
return FALSE; // Not exist video
} else {