]> git.mxchange.org Git - friendica.git/commitdiff
Fix httpdesc to work with new namespace
authorHypolite Petovan <mrpetovan@gmail.com>
Fri, 24 Nov 2017 04:47:52 +0000 (23:47 -0500)
committerHypolite Petovan <mrpetovan@gmail.com>
Fri, 24 Nov 2017 04:47:52 +0000 (23:47 -0500)
src/Network/HTTPException.php

index eec4a9ced244ddc9a50b121eceaf2285d650f806..7602290c2b873c3a7e8eddea441260e8b7feed4c 100644 (file)
@@ -11,12 +11,16 @@ namespace Friendica\Network;
 \r
 use Exception;\r
 \r
-class HTTPException extends Exception {\r
+class HTTPException extends Exception\r
+{\r
        var $httpcode = 200;\r
        var $httpdesc = "";\r
-       public function __construct($message = "", $code = 0, Exception $previous = null) {\r
-               if ($this->httpdesc == "") {\r
-                       $this->httpdesc = preg_replace("|([a-z])([A-Z])|",'$1 $2', str_replace("Exception","",get_class($this)));\r
+\r
+       public function __construct($message = '', $code = 0, Exception $previous = null)\r
+       {\r
+               if ($this->httpdesc == '') {\r
+                       $classname = str_replace('Exception', '', str_replace('Friendica\Network\HTTPException\\', '', get_class($this)));\r
+                       $this->httpdesc = preg_replace("|([a-z])([A-Z])|",'$1 $2', $classname);\r
                }\r
                parent::__construct($message, $code, $previous);\r
        }\r