Changeset a08a60e in github


Ignore:
Timestamp:
Nov 1, 2007 5:51:14 AM (6 years ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
ff0566b
Parents:
6270699
Message:

Also remove unclosed script tags (fixes XSS vulnerability)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • program/steps/mail/func.inc

    recd2e79 ra08a60e  
    974974  foreach (array('script', 'applet', 'object', 'embed', 'iframe') as $tag) 
    975975    { 
    976     while (($pos = strpos($body_lc, '<'.$tag)) && ($pos2 = strpos($body_lc, '</'.$tag.'>', $pos))) 
    977       { 
    978       $pos2 += strlen('</'.$tag.'>'); 
    979       $body = substr($body, 0, $pos) . substr($body, $pos2, strlen($body)-$pos2); 
     976    while (($pos = strpos($body_lc, '<'.$tag)) && (($pos2 = strpos($body_lc, '</'.$tag.'>', $pos)) || ($pos3 = strpos($body_lc, '>', $pos)))) 
     977      { 
     978      $end = $pos2 ? $pos2 + strlen('</'.$tag.'>') : $pos3 + 1; 
     979      $body = substr($body, 0, $pos) . substr($body, $end, strlen($body)-$end); 
    980980      $body_lc = strtolower($body); 
    981981      } 
Note: See TracChangeset for help on using the changeset viewer.