Package: ikiwiki
Version: 2.20
Severity: normal
Tags: patch
The attached patch adds support for embedding (supposedly) safe <script>
snippets coming from AdSense configuration in ikiwiki pages, even when
the htmlscrubber plugin is enabled. I'm not entirely sure if this kind
of use is considered safe in the spirit of the embed plugin, to me it is
but YMMV.
However please note that AFAIK there is no way currently to use AdSense
with ikiwiki when htmlscrubber is enabled (beside adding AdSense
snippets in templates of course, but I would like to have it enabled and
placed on a per-page basis) and embed seems to me a good fit to solve
this issue.
Alternatively, if you consider embed.pm not a good fit, I can release a
standalone plugin which just enables AdSense ...
Let me know,
Cheers.
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.22-3-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages ikiwiki depends on:
ii libhtml-parser-perl 3.56-1 A collection of modules that parse
ii libhtml-template-perl 2.9-1 HTML::Template : A module for usin
ii liburi-perl 1.35.dfsg.1-1 Manipulates and accesses URI strin
ii markdown 1.0.1-7 Text-to-HTML conversion tool
ii perl 5.8.8-12 Larry Wall's Practical Extraction
Versions of packages ikiwiki recommends:
ii gcc [c-compiler] 4:4.2.2-2 The GNU C compiler
ii gcc-4.1 [c-compiler] 4.1.2-19 The GNU C compiler
ii gcc-4.2 [c-compiler] 4.2.2-7 The GNU C compiler
ii git-core 1:1.5.3.8-1 fast, scalable, distributed revisi
ii libc6-dev [libc-dev] 2.7-6 GNU C Library: Development Librari
ii libcgi-formbuilder-perl 3.05.01-1 Easily generate and process statef
ii libcgi-session-perl 4.20-2 Persistent session data in CGI app
ii libhtml-scrubber-perl 0.08-4 Perl extension for scrubbing/sanit
ii liblwpx-paranoidagent-pe 1.03-1 a "paranoid" subclass of LWP::User
ii libmail-sendmail-perl 0.79-4 Send email from a perl script
ii libnet-openid-consumer-p 0.14-1 library for consumers of OpenID id
ii libtime-duration-perl 1.02-1 Time::Duration -- rounded or exact
ii libtimedate-perl 1.1600-9 Time and date functions for Perl
ii libxml-simple-perl 2.18-1 Perl module for reading and writin
ii mercurial 0.9.5-3 Scalable distributed version contr
ii subversion 1.4.4dfsg1-1 Advanced version control system
ii tla 1.3.5+dfsg-9+b1 GNU Arch revision control system
-- no debconf information
--- /usr/share/perl5/IkiWiki/Plugin/embed.pm 2007-12-31 23:58:04.000000000
+0100
+++ .ikiwiki/IkiWiki/Plugin/embed.pm 2008-01-28 17:07:17.000000000 +0100
@@ -39,6 +39,19 @@
<\s*iframe\s+src="http://www.google.com/calendar/embed\?src=$attribr"\s+
style="\s*border-width:\d+\s*"\s+width="\d+"\s+frameborder="\d+"\s*
height="\d+"\s*>\s*</iframe>
+
+ |
+
+ # google adsense
+ <script\s*type="text/javascript">\s*<!--\s+
+ google_ad_client\s*=\s*"$attribr";\s+
+ //[^\r\n]*\s+
+ google_ad_slot\s*=\s*"$attribr";\s+
+ google_ad_width\s*=\s*\d+;\s+
+ google_ad_height\s*=\s*\d+;\s+
+ //\s*-->\s*</script>\s+
+ <script\s*type="text/javascript"\s+
+
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\s+</script>
)}sx;
my @embedded;