Ignore:
Timestamp:
06/22/09 09:47:02 (15 years ago)
Author:
amuller
Message:

Ticket #559 - Atualização de segurança

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/inc/class.imap_functions.inc.php

    r1035 r1036  
    11<?php 
     2        $GLOBALS['phpgw_info']['flags'] = array( 
     3                'currentapp' => 'expressoMail1_2', 
     4                'nonavbar'   => true, 
     5                'noheader'   => true 
     6        ); 
     7 
     8        require_once $_SERVER[ 'DOCUMENT_ROOT' ] . '/header.inc.php'; 
    29include_once("class.functions.inc.php"); 
    310include_once("class.ldap_functions.inc.php"); 
     
    10001007                } 
    10011008                // Malicious Code Remove 
    1002                 $dirtyCodePattern = "/(<([\w]+)([^>]*)on(mouse(move|over|down|up)|load|blur|change|click|dblclick|focus|key(down|up|press)|select)=[\"'][^>\"']*[\"']([^>]*)>)(.*)(<\/\\2>)?/isU"; 
     1009                $dirtyCodePattern = "/(<([\w]+[\w0-9]*)([^>]*)on(mouse(move|over|down|up)|load|blur|change|click|dblclick|focus|key(down|up|press)|select)(\ *)=(\ *)[\"'][^>\"']*[\"']([^>]*)>)(.*)(<\/\\2>)?/misU"; 
    10031010                preg_match_all($dirtyCodePattern,$body,$rest,PREG_PATTERN_ORDER); 
    10041011                foreach($rest[0] as $i => $val) 
    1005                         if (!(preg_match("/window\.open/i",$rest[1][$i]) && strtoupper($rest[4][$i]) == "CLICK" )) //Calendar events 
     1012                        if (!(preg_match("/javascript:window\.open\(\"\/index\.php\?menuaction=calendar\.uicalendar\.set_action\&cal_id=([^;'\"]+);?['\"]/i",$rest[1][$i]) && strtoupper($rest[4][$i]) == "CLICK" )) //Calendar events 
    10061013                                $body = str_replace($rest[1][$i],"<".$rest[2][$i].$rest[3][$i].$rest[7][$i].">",$body); 
    10071014 
     
    10131020                // Verify exception. 
    10141021                @preg_match("/<a href=\"notes:\/\/\//",$body,$matches); 
    1015                 // It no has exception,then open the link in new window. 
     1022                // If there is no exception,then open the link in new window. 
    10161023                if(count($matches)) 
    10171024                        return $body; 
Note: See TracChangeset for help on using the changeset viewer.