Add Core\Logger to the introspection skip class list

- Make class list explicit to avoid confusion between similar class names
- Update skipped class string match to a safer "starts with" condition
This commit is contained in:
Hypolite Petovan 2022-12-28 17:54:37 -05:00
parent 9dbcbe0482
commit 8b1947bd78
2 changed files with 4 additions and 5 deletions

View 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,
];
/**

View 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;
}
}