Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
--TEST-- Test fopen() for reading UTF-8 path with cp1250 specific symbols --SKIPIF-- <?php..
Decoded Output download
--TEST--
Test fopen() for reading UTF-8 path with cp1250 specific symbols
--SKIPIF--
<?php
include __DIR__ . DIRECTORY_SEPARATOR . "util.inc";
skip_if_not_win();
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
skip_if_no_required_exts();
?>
--CONFLICTS--
file_cp1250
--FILE--
<?php
/*
#vim: set fileencoding=cp1250
#vim: set encoding=cp1250
*/
include __DIR__ . DIRECTORY_SEPARATOR . "util.inc";
$item = "_"; // cp1250 specific chars
$prefix = create_data("file_cp1250", $item);
$fn = $prefix . DIRECTORY_SEPARATOR . $item;
$f = fopen($fn, 'r');
if ($f) {
var_dump($f, fread($f, 42));
var_dump(fclose($f));
} else {
echo "open utf8 failed
";
}
remove_data("file_cp1250");
?>
--EXPECTF--
resource(%d) of type (stream)
string(37) "reading file wihh multibyte filename
"
bool(true)
Did this file decode correctly?
Original Code
--TEST--
Test fopen() for reading UTF-8 path with cp1250 specific symbols
--SKIPIF--
<?php
include __DIR__ . DIRECTORY_SEPARATOR . "util.inc";
skip_if_not_win();
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
skip_if_no_required_exts();
?>
--CONFLICTS--
file_cp1250
--FILE--
<?php
/*
#vim: set fileencoding=cp1250
#vim: set encoding=cp1250
*/
include __DIR__ . DIRECTORY_SEPARATOR . "util.inc";
$item = "_"; // cp1250 specific chars
$prefix = create_data("file_cp1250", $item);
$fn = $prefix . DIRECTORY_SEPARATOR . $item;
$f = fopen($fn, 'r');
if ($f) {
var_dump($f, fread($f, 42));
var_dump(fclose($f));
} else {
echo "open utf8 failed\n";
}
remove_data("file_cp1250");
?>
--EXPECTF--
resource(%d) of type (stream)
string(37) "reading file wihh multibyte filename
"
bool(true)
Function Calls
None |
Stats
MD5 | 862fcd9fdca968b995dc77d1ae7522d7 |
Eval Count | 0 |
Decode Time | 114 ms |