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 8cc9f27..ec68375 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);