Opened 16 years ago
Closed 15 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)
by , 16 years ago
| Attachment: | weather.diff added |
|---|
comment:2 by , 16 years ago
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 by , 16 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:4 by , 15 years ago
| 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.
by , 15 years ago
| Attachment: | WeatherScreen.diff added |
|---|
Fix for GetData function runScript argument escaping
comment:5 by , 15 years ago
| Status: | new → assigned |
|---|
comment:6 by , 15 years ago
| Milestone: | unknown → 0.24 |
|---|

Another solution: add escapeshellcmd to method WeatherScreen::runScript:
$command = escapeshellcmd("$script $args");