Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Excel-Writer-XLSX CPAN distribution.

Report information
The Basics
Id: 75808
Status: resolved
Worked: 1 hour (60 min)
Priority: 0/
Queue: Excel-Writer-XLSX

People
Owner: Nobody in particular
Requestors: oleg [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: write_url() with bad url corrupts document
Example: use strict; use Excel::Writer::XLSX; my $b = Excel::Writer::XLSX->new("t.xlsx"); my $w = $b->add_worksheet(); $w->write_url(0, 0, "http://google.com\n"); # bad # $w->write_url(0, 0, "http://goog\0le.com"); # bad # $w->write_url(0, 0, "http://goo gle.com"); # bad __END__ MS. Office will suggest to fix document when you'll try to open this file. Faced out with this problem when one of the url was with space at the end.
On Fri Mar 16 04:06:17 2012, OLEG wrote: Show quoted text
> $w->write_url(0, 0, "http://google.com\n"); # bad > # $w->write_url(0, 0, "http://goog\0le.com"); # bad > # $w->write_url(0, 0, "http://goo gle.com"); # bad
Hi Oleg, Are any of these valid use cases? As far as I can tell Excel doesn't accept any of these as valid input. If they aren't valid use cases then perhaps it would be better to just sanitise the input data in the client program. What do you think? Regards, John. --
Срд Мар 21 07:18:04 2012, JMCNAMARA писал: Show quoted text
> On Fri Mar 16 04:06:17 2012, OLEG wrote: >
> > $w->write_url(0, 0, "http://google.com\n"); # bad > > # $w->write_url(0, 0, "http://goog\0le.com"); # bad > > # $w->write_url(0, 0, "http://goo gle.com"); # bad
> > Hi Oleg, > > Are any of these valid use cases? > > As far as I can tell Excel doesn't accept any of these as valid input. > > If they aren't valid use cases then perhaps it would be better to just > sanitise the input data in the client program. > > What do you think? > > Regards, > > John.
Hi John, I think this issue should be documented. And may be module should check url for bad symbols and die. Or may be emit warning and use write_string() instead. I mean we should have some diagnostic. Or atleast know about potential problems.
On Wed Mar 21 07:55:35 2012, OLEG wrote: Show quoted text
> > I think this issue should be documented. And may be module should
check Show quoted text
> url for bad symbols and die. Or may be emit warning and use > write_string() instead. > I mean we should have some diagnostic. Or atleast know about potential > problems.
Hi, You are right. There should be some warning at least. I'll add one. Thanks, John. --
Hi, I've added a fix for this to Excel::Writer::XLSX version 0.47. The write_url() method now throws a warning and rejects the invalid url to avoid file corruption. Thanks for your report. Regards, John. --