]> git.donarmstrong.com Git - roundcube.git/blobdiff - program/steps/mail/get.inc
Imported Upstream version 0.7.1
[roundcube.git] / program / steps / mail / get.inc
index 16f7acf63b67aa6aab2a8bf70ce4b79131dd4c80..0c11eb23395bf81ab53459b41072276b8292c7a1 100644 (file)
@@ -5,7 +5,7 @@
  | program/steps/mail/get.inc                                            |
  |                                                                       |
  | This file is part of the Roundcube Webmail client                     |
- | Copyright (C) 2005-2009, The Roundcube Dev Team                       |
+ | Copyright (C) 2005-2011, The Roundcube Dev Team                       |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
@@ -15,7 +15,7 @@
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: get.inc 5514 2011-11-30 11:35:43Z alec $
+ $Id: get.inc 5635 2011-12-21 10:07:42Z alec $
 
 */
 
@@ -179,39 +179,3 @@ header('HTTP/1.1 404 Not Found');
 exit;
 
 
-
-/**
- * PHP stream filter to detect html/javascript code in attachments
- */
-class rcube_content_filter extends php_user_filter
-{
-  private $buffer = '';
-  private $cutoff = 2048;
-
-  function onCreate()
-  {
-    $this->cutoff = rand(2048, 3027);
-    return true;
-  }
-
-  function filter($in, $out, &$consumed, $closing)
-  {
-    while ($bucket = stream_bucket_make_writeable($in)) {
-      $this->buffer .= $bucket->data;
-
-      // check for evil content and abort
-      if (preg_match('/<(script|iframe|object)/i', $this->buffer))
-        return PSFS_ERR_FATAL;
-
-      // keep buffer small enough
-      if (strlen($this->buffer) > 4096)
-        $this->buffer = substr($this->buffer, $this->cutoff);
-
-      $consumed += $bucket->datalen;
-      stream_bucket_append($out, $bucket);
-    }
-
-    return PSFS_PASS_ON;
-  }
-}
-