!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/laravel-crm/vendor/webklex/php-imap/tests/   drwxrwxrwx
Free 13.21 GB of 57.97 GB (22.8%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     PartTest.php (3.56 KB)      -rw-rw-rw-
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/*
* File: StructureTest.php
* Category: -
* Author: M.Goldenbaum
* Created: 28.12.22 18:11
* Updated: -
*
* Description:
*  -
*/

namespace Tests;

use 
Carbon\Carbon;
use 
PHPUnit\Framework\TestCase;
use 
Webklex\PHPIMAP\Exceptions\InvalidMessageDateException;
use 
Webklex\PHPIMAP\Exceptions\MessageContentFetchingException;
use 
Webklex\PHPIMAP\Header;
use 
Webklex\PHPIMAP\Part;
use 
Webklex\PHPIMAP\Structure;
use 
Webklex\PHPIMAP\IMAP;

class 
PartTest extends TestCase {

    
/**
     * Test parsing a text Part
     * @throws InvalidMessageDateException
     */
    
public function testTextPart(): void {
        
$raw_headers "Content-Type: text/plain;\r\n charset=UTF-8\r\nContent-Transfer-Encoding: 7bit\r\n";
        
$raw_body "\r\nAny updates?";

        
$headers = new Header($raw_headers);
        
$part = new Part($raw_body$headers0);

        
self::assertSame("UTF-8"$part->charset);
        
self::assertSame("text/plain"$part->content_type);
        
self::assertSame(12$part->bytes);
        
self::assertSame(0$part->part_number);
        
self::assertSame(false$part->ifdisposition);
        
self::assertSame(false$part->isAttachment());
        
self::assertSame("Any updates?"$part->content);
        
self::assertSame(IMAP::MESSAGE_TYPE_TEXT$part->type);
        
self::assertSame(IMAP::MESSAGE_ENC_7BIT$part->encoding);
    }

    
/**
     * Test parsing a html Part
     * @throws InvalidMessageDateException
     */
    
public function testHTMLPart(): void {
        
$raw_headers "Content-Type: text/html;\r\n charset=UTF-8\r\nContent-Transfer-Encoding: 7bit\r\n";
        
$raw_body "\r\n<p></p>\r\n<p dir=\"auto\">Any updates?</p>";

        
$headers = new Header($raw_headers);
        
$part = new Part($raw_body$headers0);

        
self::assertSame("UTF-8"$part->charset);
        
self::assertSame("text/html"$part->content_type);
        
self::assertSame(39$part->bytes);
        
self::assertSame(0$part->part_number);
        
self::assertSame(false$part->ifdisposition);
        
self::assertSame(false$part->isAttachment());
        
self::assertSame("<p></p>\r\n<p dir=\"auto\">Any updates?</p>"$part->content);
        
self::assertSame(IMAP::MESSAGE_TYPE_TEXT$part->type);
        
self::assertSame(IMAP::MESSAGE_ENC_7BIT$part->encoding);
    }

    
/**
     * Test parsing a html Part
     * @throws InvalidMessageDateException
     */
    
public function testBase64Part(): void {
        
$raw_headers "Content-Type: application/octet-stream; name=6mfFxiU5Yhv9WYJx.txt\r\nContent-Transfer-Encoding: base64\r\nContent-Disposition: attachment; filename=6mfFxiU5Yhv9WYJx.txt\r\n";
        
$raw_body "em5rNTUxTVAzVFAzV1BwOUtsMWduTEVycldFZ2tKRkF0dmFLcWtUZ3JrM2RLSThkWDM4WVQ4QmFW\r\neFJjT0VSTg==";

        
$headers = new Header($raw_headers);
        
$part = new Part($raw_body$headers0);

        
self::assertSame(""$part->charset);
        
self::assertSame("application/octet-stream"$part->content_type);
        
self::assertSame(90$part->bytes);
        
self::assertSame(0$part->part_number);
        
self::assertSame("znk551MP3TP3WPp9Kl1gnLErrWEgkJFAtvaKqkTgrk3dKI8dX38YT8BaVxRcOERN"base64_decode($part->content));
        
self::assertSame(true$part->ifdisposition);
        
self::assertSame("attachment"$part->disposition);
        
self::assertSame("6mfFxiU5Yhv9WYJx.txt"$part->name);
        
self::assertSame("6mfFxiU5Yhv9WYJx.txt"$part->filename);
        
self::assertSame(true$part->isAttachment());
        
self::assertSame(IMAP::MESSAGE_TYPE_TEXT$part->type);
        
self::assertSame(IMAP::MESSAGE_ENC_BASE64$part->encoding);
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0048 ]--