Opened 14 years ago
Closed 14 years ago
#7817 closed patch (fixed)
Add quoting to the location passed to the weather parsers
Reported by: | Owned by: | Rob Smith | |
---|---|---|---|
Priority: | trivial | Milestone: | 0.24 |
Component: | Plugin - MythWeb | Version: | head |
Severity: | low | Keywords: | wearther, quoting |
Cc: | Ticket locked: | no |
Description
Hi,
This quotes the location passed to the weather parsers so that its content is not interpreted by the command line parser.
The same kind of quoting was already done during the search of the city/town/region.
Thank you,
Nick
Attachments (2)
Change History (9)
Changed 14 years ago by
Attachment: | weather.diff added |
---|
comment:2 Changed 14 years ago by
Replying to dstancl@…:
Another solution: add escapeshellcmd to method WeatherScreen::runScript:
$command = escapeshellcmd("$script $args");
The description of what this does sounds to me like it could cause problems with some parsers.
Interesting command though... (-;
comment:3 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 Changed 14 years ago by
Resolution: | fixed |
---|---|
Status: | closed → new |
There is an error in the GetData function runScript argument escaping, last two arguments are being escaped together.
I got it working escaping arguments separately:
$output_array = $this->runScript($script, '-u '. escapeshellarg($units) .' -d '. escapeshellarg(getcwd() .'/'. data) .' '. escapeshellarg($location));
I attach a diff against [24932] with the fix.
Changed 14 years ago by
Attachment: | WeatherScreen.diff added |
---|
Fix for GetData? function runScript argument escaping
comment:5 Changed 14 years ago by
Status: | new → assigned |
---|
comment:6 Changed 14 years ago by
Milestone: | unknown → 0.24 |
---|
Another solution: add escapeshellcmd to method WeatherScreen::runScript: