]> git.mxchange.org Git - friendica.git/commitdiff
Avoid memory issue in exception
authorMichael <heluecht@pirati.ca>
Tue, 19 Feb 2019 07:49:27 +0000 (07:49 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 19 Feb 2019 07:49:27 +0000 (07:49 +0000)
src/Util/JsonLD.php

index 8cc9f274d903f25a56561c5c3259c442b2e0e6e9..ec68375d65dca8dc5e3c027af387c95772dca69a 100644 (file)
@@ -68,7 +68,7 @@ class JsonLD
                }
                catch (Exception $e) {
                        $normalized = false;
-                       Logger::log('normalise error:' . print_r($e, true), Logger::DEBUG);
+                       Logger::log('normalise error:' . substr(print_r($e, true), 0, 10000), Logger::DEBUG);
                }
 
                return $normalized;
@@ -115,7 +115,7 @@ class JsonLD
                }
                catch (Exception $e) {
                        $compacted = false;
-                       Logger::log('compacting error:' . print_r($e, true), Logger::DEBUG);
+                       Logger::log('compacting error:' . substr(print_r($e, true), 0, 10000), Logger::DEBUG);
                }
 
                $json = json_decode(json_encode($compacted, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), true);