New assignment PDF annotate - easy way to devs to allow spaces in gspath

New assignment PDF annotate - easy way to devs to allow spaces in gspath

by Oleg Sychev -
Number of replies: 2
Picture of Core developers Picture of Plugin developers

I have seen comment about not allowing spaces in path to gs in new PDF annotate feedback plugin. This can easily be avoided adding a string

$gsexec = escapeshellarg($gsexec);

before adding $gsexec to the $command. (We have similar problems running dot utility)

Also, all other paths in Moodle used to be defined in Server/System Paths even if path is used by one simple plugin, I see no reason to add gspath to other place.

Hope this will help authors of plugin to make it better.

Average of ratings: -
In reply to Oleg Sychev

Re: New assignment PDF annotate - easy way to devs to allow spaces in gspath

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

These seem like reasonable suggestions - why not visit tracker.moodle.org and open tickets with these in, so that they can be discussed and possibly implemented (the first maybe for M2.6.x, the second would probably need to be M2.7).

The only slight query I have is that I thought escapeshellarg was meant to be for arguments, not the path to the executable (and to note I've never actually been affected by the issue with spaces in the path name - it has just been reported to me by people using Windows servers, so I've passed it on in the documentation, in the hope that it will help solve some people's problems).

In reply to Davo Smith

Re: New assignment PDF annotate - easy way to devs to allow spaces in gspath

by Oleg Sychev -
Picture of Core developers Picture of Plugin developers

I created MDL-43074 for most urgent problem, and placed there a link for a code using similar approach tested on both Linuz and Windows. I will create second issue for moving the paths after first would be successfully resolved, or you can create it on you own if you wish.

P.S. As for "why not" - if you think some message is useful, why not mark it as such?