]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #6456 from annando/long-url
authorTobias Diekershoff <tobias.diekershoff@gmx.net>
Thu, 17 Jan 2019 06:44:15 +0000 (07:44 +0100)
committerGitHub <noreply@github.com>
Thu, 17 Jan 2019 06:44:15 +0000 (07:44 +0100)
This fixes a problem when the URL is too long

src/Util/Network.php

index 0acad3e082af14ffeec1684618d9099568803d1d..d4e18a8a63bb9177d69c553a5b9699c88931b310 100644 (file)
@@ -96,6 +96,11 @@ class Network
 
                $a = \get_app();
 
+               if (strlen($url) > 1000) {
+                       Logger::log('URL is longer than 1000 characters. Callstack: ' . System::callstack(20), Logger::DEBUG);
+                       return CurlResult::createErrorCurl(substr($url, 0, 200));
+               }
+
                $parts = parse_url($url);
                $path_parts = explode('/', defaults($parts, 'path', ''));
                foreach ($path_parts as $part) {