????JFIF??x?x????'403WebShell
403Webshell
Server IP : 79.136.114.73  /  Your IP : 3.133.83.94
Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f
System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64
User : www-data ( 33)
PHP Version : 5.5.9-1ubuntu4.29
Disable Function : 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,
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/self/root/home/b8009/php-5.6.22/ext/standard/tests/strings/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/home/b8009/php-5.6.22/ext/standard/tests/strings/htmlentities-utf-3.phpt
--TEST--
Test get_next_char(), used by htmlentities()/htmlspecialchars(): validity of UTF-8 sequences
--FILE--
<?php

/* conformance to Unicode 5.2, section 3.9, D92 */

$val_ranges = array(
	array(array(0x00, 0x7F)),
	array(array(0xC2, 0xDF), array(0x80, 0xBF)),
	array(array(0xE0, 0xE0), array(0xA0, 0xBF), array(0x80, 0xBF)),
	array(array(0xE1, 0xEC), array(0x80, 0xBF), array(0x80, 0xBF)),
	array(array(0xED, 0xED), array(0x80, 0x9F), array(0x80, 0xBF)),
	array(array(0xEE, 0xEF), array(0x80, 0xBF), array(0x80, 0xBF)),
	array(array(0xF0, 0xF0), array(0x90, 0xBF), array(0x80, 0xBF), array(0x80, 0xBF)),
	array(array(0xF1, 0xF3), array(0x80, 0xBF), array(0x80, 0xBF), array(0x80, 0xBF)),
	array(array(0xF4, 0xF4), array(0x80, 0x8F), array(0x80, 0xBF), array(0x80, 0xBF)),
);

function is_valid($seq) {
	global $val_ranges;
	$b = ord($seq[0]);
	foreach ($val_ranges as $l) {
		if ($b >= $l[0][0] && $b <= $l[0][1]) {
			if (count($l) != strlen($seq)) {
				return false;
			}
			for ($n = 1; $n < strlen($seq); $n++) {
				if (ord($seq[$n]) < $l[$n][0] || ord($seq[$n]) > $l[$n][1]) {
					return false;
				}
			}
			return true;
		}
	}
	return false;
}

function concordance($s) {
	$vhe = strlen(htmlspecialchars($s, ENT_QUOTES, "UTF-8")) > 0;
	$v = is_valid($s);
	return ($vhe === $v);
}

for ($b1 = 0xC0; $b1 < 0xE0; $b1++) {
	for ($b2 = 0x80; $b2 < 0xBF; $b2++) {
		$s = chr($b1).chr($b2);
		if (!concordance($s))
			echo "Discordance for ".bin2hex($s),"\n";
	}
}


for ($b1 = 0xE0; $b1 < 0xEF; $b1++) {
	for ($b2 = 0x80; $b2 < 0xBF; $b2++) {
		$s = chr($b1).chr($b2)."\x80";
		if (!concordance($s))
			echo "Discordance for ".bin2hex($s),"\n";
		$s = chr($b1).chr($b2)."\xBF";
		if (!concordance($s))
			echo "Discordance for ".bin2hex($s),"\n";
	}
}

for ($b1 = 0xF0; $b1 < 0xFF; $b1++) {
	for ($b2 = 0x80; $b2 < 0xBF; $b2++) {
		$s = chr($b1).chr($b2)."\x80\x80";
		if (!concordance($s))
			echo "Discordance for ".bin2hex($s),"\n";
		$s = chr($b1).chr($b2)."\xBF\x80";
		if (!concordance($s))
			echo "Discordance for ".bin2hex($s),"\n";
		$s = chr($b1).chr($b2)."\x80\xBF";
		if (!concordance($s))
			echo "Discordance for ".bin2hex($s),"\n";
		$s = chr($b1).chr($b2)."\xBF\xBF";
		if (!concordance($s))
			echo "Discordance for ".bin2hex($s),"\n";
	}
}
echo "Done.\n";
--EXPECT--
Done.

Youez - 2016 - github.com/yon3zu
LinuXploit