loadsys / CakePHP-ConfigReadShell

A CakePHP plugin that provides a Shell to read an app's Configure vars from the command line.
MIT License
3 stars 0 forks source link

Error when a Config value is not a string and is an object or something else #1

Open justinyost opened 9 years ago

justinyost commented 9 years ago

Screenshot included.

Examples of when this occurs is the Error handlers, with this command:

./bin/cake config_read.config_read Error

screen shot 2015-01-16 at 3 45 36 pm

beporter commented 9 years ago

It's worth mentioning that if an object doesn't define a __toString() method, there's very little we can do about this except detect that and skip the entry maybe?

I may have also neglected to force the casting to string though.

beporter commented 9 years ago

@jtyost2 Might I recommend we fix this and #2 in the 2.x branch before we split the codebase off for Cake 3?

beporter commented 9 years ago

Can probably just change this line: https://github.com/loadsys/CakePHP-ConfigReadShell/blob/2edf35566c0c3ae1703da8c8d3f359b9087344c4/Console/Command/ConfigReadShell.php#L142

$val = escapeshellarg((string)$val);