-
-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CoreGatewayFactory try to call gateway's string config parameter that accidentally same as name of php built-in function #692
Comments
It must've happened. Any thoughts on how to fix it? |
As for me we can add checks for string type or function existing // Not strings
foreach ($config as $name => $value) {
if (!is_string($value) && is_callable($value)) {
$config[$name] = call_user_func($value, $config);
}
}
// OR Not existing functions (but strings for static methods)
foreach ($config as $name => $value) {
if (is_string($value) && function_exists($value)) {
continue;
}
if (is_callable($value)) {
$config[$name] = call_user_func($value, $config);
}
} but maybe someone uses facades (like in Laravel) or some functions that return needed value without arguments (maybe functions that increments some static properties etc). I didn't find good solution yet. So I decide to make workaround (add prefix to that value in my config). |
@Great-Antique Hi, can you please tell me which project you're using as safecharge gateway? |
@diimpp Hello. I'm currently developing lib, gateway and bundle for SafeCharge. It's very possible that it will be opensourced. But I can't tell you deadlines |
@makasim any news about this bug? Had the same problem with "sha1" value |
Got the same issue with |
@Kocal simple workaround is to not use such names. Just add some prefix. In existing gateways there are no such cases so I assume that you talk about some custom code. I use something like |
Yeah that's what I've done too... Not a big fan but better than nothing 🤷 |
I have a config of Payum gateways like this (in Symfony):
When I run application I have an issue
Stack:
So
CoreGatewayFactory
try to runmd5($config)
where$config
is an object.The text was updated successfully, but these errors were encountered: