diff options
Diffstat (limited to 'ajax.php')
| -rw-r--r-- | ajax.php | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -18,15 +18,19 @@ $curl = curlInfo($vidurl); $filesize = $curl[2]; $size = BytesHumanSize($filesize); -if($filesize < $MAXSIZE && $filesize != 0){ /* 50M */ +// checks if the http respond code is valid or if the filesize not empty +if ($curl[0] >= 400 || $filesize == 0){ + $filesize = "<p style=\"color:red;\">Size: ".$size." (Error: Access forbidden!)</p>"; + if($curl[0] >= 400) + header($_SERVER['SERVER_PROTOCOL'] . " $curl[0] forbidden"); +} else if($filesize < $MAXSIZE && $filesize != 0){ /* 50M, now 200M */ $filesize = "<p style='color:green;'>Size: ".$size."</p>"; +/* } else if($filesize < $STREAM_MAXSIZE && $filesize != 0){ $filesize = "<p style='color:red;'>Size: ".$size." (only streaming supported!)</p>"; -} else if($filesize != 0) { - $filesize = "<p style='color:red;'>Size: ".$size." (not supported!)</p>"; +*/ } else { - $filesize = "<p style=\"color:red;\">Size: ".$size." (Access forbidden!)</p>"; - header($_SERVER['SERVER_PROTOCOL'] . " $curl[0] forbidden"); + $filesize = "<p style=\"color:red\">Size: ".$size." (Error: File too large!)"; } echo $filesize; |
