Skip to content
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

problem with Monolog integration #24

Closed
kamilsk opened this issue Mar 15, 2016 · 2 comments
Closed

problem with Monolog integration #24

kamilsk opened this issue Mar 15, 2016 · 2 comments

Comments

@kamilsk
Copy link
Contributor

kamilsk commented Mar 15, 2016

Hi! I found a mistake when writing handler for Monolog based on your useful library:

use Joli\JoliNotif\Notification;
use Joli\JoliNotif\NotifierFactory;

($notifier = NotifierFactory::create()) && $notifier->send(
    (new Notification())
        ->setTitle('Something happen')
        // problem body:
        // ->setBody('[2016-03-15 14:17:21] test.INFO: test [] {"time_execution":"0.000"}')
        // it's ok
        ->setBody('[2016-03-15 14:17:21] test.INFO: test [] {time_execution:0.000}')
);

Problem located here: https://github.com/jolicode/JoliNotif/blob/v1.0.4/src/Notifier/AppleScriptNotifier.php#L56

Possible solution:

$script = 'display notification "'. addslashes($notification->getBody()) .'"';

What do you think? Can I fix it?

@pyrech
Copy link
Member

pyrech commented Mar 15, 2016

Hi :)

I think Symfony\Component\Process\ProcessUtils::escapeArgument() would be better to escape properly the body but not sure it will fix the problem. Could give you give it a try and open a PR? Thanks 😉

@kamilsk
Copy link
Contributor Author

kamilsk commented Mar 15, 2016

I tested, works fine.

Could give you give it a try and open a PR?

Yeah, one moment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants