-
Notifications
You must be signed in to change notification settings - Fork 402
Description
Regarding this line:
sdk-php/lib/net/authorize/util/Log.php
Line 163 in e1acf55
| $prop->setValue($obj,preg_replace($inputPattern,$inputReplacement,$prop->getValue($obj))); |
Previously, attempting to omit the cardCode value on "Stored Card" transaction (because the card code was not known / not obtained from the user), while SDK logging is enabled, would cause the referenced line to attempt to perform preg_replace() on a NULL value when parsing the card code value. (I guess in the above scenario, when $prop->getValue() returns NULL when the cardCode value was not set.)
Since passing NULL to the 3rd argument of preg_replace() is deprecated, it throws the error.
My fix was to simply cast the return value of $prop->getValue() as a string to ensure an empty string is passed instead of NULL.
Is this something that has been resolved elsewhere in the codebase and no longer needs to force the string? IE, is something changed were attempting to process a property that was not set, would now return an empty string rather than NULL?
Since this comes directly from a built-in reflection class, it seems, I don't think this is resolved in the current version.
To that end, I just published a PR that fixes this issue.
PR: #459
I'm OK using my fork, but it would be better for everyone if this gets merged to the main codebase.