Fix notices in Parse URL feature
authorHypolite Petovan <hypolite@mrpetovan.com>
Tue, 16 Oct 2018 22:27:13 +0000 (18:27 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Tue, 16 Oct 2018 22:27:13 +0000 (18:27 -0400)
mod/parse_url.php
src/Util/ParseUrl.php

index 40eddc3..a14379e 100644 (file)
@@ -73,6 +73,7 @@ function parse_url_content(App $a)
                                $hdrs[$k] = $v;
                        }
                }
+               $type = null;
                if (array_key_exists('Content-Type', $hdrs)) {
                        $type = $hdrs['Content-Type'];
                }
index f2a5ecc..24089b9 100644 (file)
@@ -141,7 +141,7 @@ class ParseUrl
                }
 
                // If the file is too large then exit
-               if ($curlResult->getInfo()['download_content_length'] > 1000000) {
+               if (defaults($curlResult->getInfo(), 'download_content_length', 0) > 1000000) {
                        return $siteinfo;
                }