[prev in list] [next in list] [prev in thread] [next in thread]
List: squirrelmail-cvs
Subject: [SM-CVS] SF.net SVN: squirrelmail:[14839] trunk/squirrelmail/functions/mime.php
From: pdontthink--- via squirrelmail-cvs <squirrelmail-cvs () lists ! sourceforge ! net>
Date: 2020-01-07 6:49:42
Message-ID: 1578379783.64896.5556 () sfp-scm-1 ! v30 ! lw ! sourceforge ! com
[Download RAW message or body]
Revision: 14839
http://sourceforge.net/p/squirrelmail/code/14839
Author: pdontthink
Date: 2020-01-07 06:49:42 +0000 (Tue, 07 Jan 2020)
Log Message:
-----------
Even better HTML email content style containment
Modified Paths:
--------------
trunk/squirrelmail/functions/mime.php
Modified: trunk/squirrelmail/functions/mime.php
===================================================================
--- trunk/squirrelmail/functions/mime.php 2020-01-07 06:36:26 UTC (rev 14838)
+++ trunk/squirrelmail/functions/mime.php 2020-01-07 06:49:42 UTC (rev 14839)
@@ -2124,9 +2124,17 @@
* body {background: blah-blah}
* and change it to .bodyclass so we can just assign it to a <div>
*/
- // Let's try out something that catches stuff like: body, p, div { or stuff \
like: body a {
// $content = preg_replace("|body(\s*\{.*?\})|si", ".bodyclass\\1", $content);
- $content = preg_replace("/body((?:\s*(?:,| )\s*[a-z0-9_-]+)*\s*\{.*?\})/si", \
".bodyclass\\1", $content); + // Nah, this is even better - try to preface all CSS \
selectors with + // our <div> class ID "bodyclass" then correct generic "body" \
selectors + // TODO: this works pretty good but breaks stuff like this:
+ // @media print { body { font-size: 10pt; } }
+ // but there isn't an easy way to make this regex skip @media
+ // definitions... though lots of the ones in the wild will be
+ // correctly handled because they tend to end with a parenthesis, like:
+ // @media screen and (max-width:480px) { ...
+ $content = preg_replace('/([a-z0-9._-][a-z0-9 >+~|:._-]*\s*(?:,|{.*?}))/si', \
'.bodyclass $1', $content); + $content = str_replace('.bodyclass body', \
'.bodyclass', $content);
global $use_transparent_security_image;
if ($use_transparent_security_image) $secremoveimg = '../images/spacer.png';
This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.
-----
squirrelmail-cvs mailing list
List address: squirrelmail-cvs@lists.sourceforge.net
List info (subscribe/unsubscribe/change options): \
https://lists.sourceforge.net/lists/listinfo/squirrelmail-cvs
Repository: http://squirrelmail.org/svn
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic