PHP log(arithm) function triggers unrelated validation error

Created on 4 March 2024, 10 months ago

Problem/Motivation

When using the php log function (https://www.php.net/manual/en/function.log.php) handles it as a function to log an error and fires the error message "In log(), the log level should be followed by a literal string. There should be no variables, concatenation, constants or even a t() call there." when passing a variable as first parameter. This is obviously a good validation for a logger function but not for the php log function which requires a number value as first parameter which normally comes from a variable.

The related code in my case was:

$x = log($resolution[0], 2);

which should not interfere with translation related validations.

Proposed resolution

Adjust the validation to ignore the php log function as it's unrelated to logging.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇩🇪Germany joe.P

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024