]> git.mxchange.org Git - friendica.git/commitdiff
Add Core\Logger to the introspection skip class list
authorHypolite Petovan <hypolite@mrpetovan.com>
Wed, 28 Dec 2022 22:54:37 +0000 (17:54 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Wed, 28 Dec 2022 22:54:37 +0000 (17:54 -0500)
- Make class list explicit to avoid confusion between similar class names
- Update skipped class string match to a safer "starts with" condition

src/Core/Logger/Capabilities/IHaveCallIntrospections.php
src/Core/Logger/Util/Introspection.php

index e9f27ee1adaa2f057ba94713ab15c9b780f75dc1..a3ce90f1d3cbd761c62be740f4a01ffecbb07d7f 100644 (file)
@@ -20,8 +20,6 @@
  */
 
 namespace Friendica\Core\Logger\Capabilities;
-use Friendica\Core\Logger\Factory\Logger;
-use Friendica\Util\Profiler;
 
 interface IHaveCallIntrospections
 {
@@ -31,9 +29,10 @@ interface IHaveCallIntrospections
         * @var string[]
         */
        public const IGNORE_CLASS_LIST = [
-               Logger::class,
-               Profiler::class,
+               \Friendica\Core\Logger::class,
+               \Friendica\Core\Logger\Factory\Logger::class,
                'Friendica\\Core\\Logger\\Type',
+               \Friendica\Util\Profiler::class,
        ];
 
        /**
index bf1b77160d40142c57d4750ac39e69c782687ca6..2db30621efa064c6973c144c8f71ed9cf53d3d17 100644 (file)
@@ -104,7 +104,7 @@ class Introspection implements IHaveCallIntrospections
 
                if (isset($traceItem['class'])) {
                        foreach ($this->skipClassesPartials as $part) {
-                               if (strpos($traceItem['class'], $part) !== false) {
+                               if (strpos($traceItem['class'], $part) === 0) {
                                        return true;
                                }
                        }