Skip Menu |

This queue is for tickets about the MIME-Lite-HTML CPAN distribution.

Report information
The Basics
Id: 19655
Status: resolved
Priority: 0/
Queue: MIME-Lite-HTML

People
Owner: alian [...] alianwebserver.com
Requestors: rjbs [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.8
Fixed in: 1.22



Subject: include_css is far too aggressive
The &include_css routine is far too aggressive. It will replace nearly any link element in the head. This line should be added directly after sub pattern_css's declaration ends: return $gabarit unless $gabarit =~ /stylesheet/i; Even this is sub-par, but it will eliminate many problems. (For what it's worth, declaring a subroutine inside a subroutine nearly certainly doesn't do what you think; it is still globally available, but now encloses unused variables; it's quite confusing.) -- rjbs
On Thu Jun 01 21:05:52 2006, RJBS wrote: Show quoted text
> The &include_css routine is far too aggressive. It will replace nearly > any link element in the head. This line should be added directly after > sub pattern_css's declaration ends: > > return $gabarit unless $gabarit =~ /stylesheet/i;
This bug is nearly two months old. Is this distribution abandoned?
I sent the author another email about this. -- rjbs
On Thu Jun 01 21:05:52 2006, RJBS wrote: Show quoted text
> The &include_css routine is far too aggressive. It will replace nearly > any link element in the head. This line should be added directly after > sub pattern_css's declaration ends: > > return $gabarit unless $gabarit =~ /stylesheet/i;
I confirm this bug. I put this at beginning of include_css: if ($milieu!~/stylesheet/i && $fin!~/stylesheet/i) { return "<link".$milieu." href=\"$url\"".$fin.">"; } because the bug was always present with your add when there is stylesheet in a page. Eg: <link rel="stylesheet" href="soft.css"> <LINK REV="made" HREF="mailto:bob@alianwebserver.com">