[Bug 830] Changed - IMP3 RC4's handling of HTML pages

bugs@bugs.horde.org bugs@bugs.horde.org
Wed, 2 Jan 2002 01:04:23 -0400


http://bugs.horde.org/show_bug.cgi?id=830

*** shadow/830	Wed Jan  2 01:03:22 2002
--- shadow/830.tmp.16340	Wed Jan  2 01:04:23 2002
***************
*** 25,27 ****
--- 25,60 ----
  error, IMP will just not return anything (the browser will eventual give up 
  after a few minutes)...  This is kinda bad...  I can forward an example of such 
  message if you would like (I exported one of them to a file).
+ 
+ ------- Additional Comments From complexity@bigfoot.com  01/02/02 01:04 -------
+ This is fixed as per the follow diff file supplied by Jon Parise
+ 
+ Index: html.php
+ ===================================================================
+ RCS file: /repository/imp/lib/MIME/Viewer/html.php,v
+ retrieving revision 1.6
+ diff -u -r1.6 html.php
+ --- html.php	19 Dec 2001 17:01:33 -0000	1.6
+ +++ html.php	2 Jan 2002 03:07:21 -0000
+ @@ -38,15 +38,15 @@
+              if ($base[strlen($base) - 1] != '/')
+                  $base .= '/';
+          }
+ -    
+ +
+          /* Nuke non-printing characters. */
+          $data = preg_replace('/(
|	|&#013|	)/', '', $data);
+      
+          /* Get all attribute="javascript:foo()" tags. */
+          $data = preg_replace('/=\s*([^>]*)(\w*)\s*s\s*(c|c|&#099|c)
+ \s*r\s*i\s*p\s*t\s*:/i', '=\1cleaned', $data);
+ -    
+ +
+          /* Get all on<foo>="bar()" tags. */
+ -        $data = ereg_replace('([^>]*)(\w*)[^f]*[Oo]\s*[Nn]
+ \s*\w*=', '\1cleaned=', $data);
+ +        $data = preg_replace('/(\s+[Oo][Nn]\w+)=/', '\1Cleaned=', $data);
+      
+          /* Get all tags that might cause trouble - <script>, <embed>,
+             etc. Meta refreshes and iframes, too. */
+