www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 1e20c8cb53542dcb79761a6fd8abcc9ae07ee61e
parent f0479993399d967d54d8a183703b68ed9534e022
Author: Dan Stillman <dstillman@zotero.org>
Date:   Thu, 19 Jan 2012 15:50:27 -0500

Fix saving of "@22" files in snapshots

CSS rules were being made available to WebPageDump with double-quotes in
the url() rules, despite the original rules not containing them. WPD's
regexp for parsing url() rules included the quotes in the captured
strings, which prevented relative URLs from being properly interpeted --
they were instead appended to the base URL, resulting in "@22" (") at the
end and 404s (sometimes with large HTML pages) that were then saved to
disk instead of the image.

Diffstat:
Mchrome/content/zotero/webpagedump/domsaver.js | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/chrome/content/zotero/webpagedump/domsaver.js b/chrome/content/zotero/webpagedump/domsaver.js @@ -597,7 +597,8 @@ var wpdDOMSaver = { if ( !aCSStext ) return ""; // search for "url" entries inside the css - var re = new RegExp(/ url\(([^\'\)]+)\)/); + // Double-quotes in regexp added by Dan S. for Zotero + var re = new RegExp(/ url\("?([^'")]+)"?\)/); var i = 0; while ( aCSStext.match(re) ) { if ( ++i > 20 ) break; // safer (we try it maximal 20 times for one stylesheet element)