This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8" /> | |
<title><Hello X'SS!></title> | |
</head> | |
<body> | |
<h1><Hello X'SS!></h1> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Acme; | |
use Volcanus\Error; | |
class U | |
{ | |
public static function H($data, $filter = null) | |
{ | |
$var = (isset($data)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Acme; | |
use Volcanus\TokenProcessor; | |
class U | |
{ | |
public static function H($data, $filter = null) { | |
$var = (isset($data)) | |
? htmlspecialchars($data, ENT_QUOTES, 'UTF-8') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
assert_options(ASSERT_ACTIVE, 1); | |
assert_options(ASSERT_WARNING, 0); | |
assert_options(ASSERT_CALLBACK, function ($file, $line) { | |
echo '<pre>' . htmlspecialchars(sprintf("Assertion Failed: at %s[%d]\n", $file, $line)) . '</pre>'; | |
}); | |
//$name = '" /><script>alert("Hello!");</script><input type="hidden" name="'; // urlencode()もHTMLエスケープもされない | |
$name = 'token'; | |
$value = '"<Baz & Qux>"'; // urlencode()され、HTMLエスケープされない |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Acme; | |
class AccessLog { | |
public $id; | |
public $access_date; | |
public $uri; | |
public $uri_path; | |
public $uri_query; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Acme; | |
$mode = \RecursiveIteratorIterator::LEAVES_ONLY; | |
//$mode = \RecursiveIteratorIterator::SELF_FIRST; | |
//$mode = \RecursiveIteratorIterator::CHILD_FIRST; | |
$iterator = new \RecursiveIteratorIterator( | |
new \RecursiveDirectoryIterator(__DIR__ . DIRECTORY_SEPARATOR . 'DIR', | |
\FilesystemIterator::CURRENT_AS_FILEINFO | // current()メソッドでSplFileInfoのインスタンスを返す |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* PHP versions 5 | |
* | |
* @copyright 2011 k-holy <[email protected]> | |
* @author [email protected] | |
* @license http://www.opensource.org/licenses/mit-license.php The MIT License (MIT) | |
*/ | |
namespace Holy\Slim\View; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* PHP versions 5 | |
* | |
* @copyright 2011 k-holy <[email protected]> | |
* @author [email protected] | |
* @license http://www.opensource.org/licenses/mit-license.php The MIT License (MIT) | |
*/ | |
namespace Holy; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Acme; | |
class U { | |
public static function H($data, $default = null) { | |
if (isset($data)) { | |
return htmlspecialchars($data, ENT_QUOTES, 'UTF-8'); | |
} | |
return $default; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Acme; | |
// SPLのファイル処理クラスSplFileObjectとPHP5.4のCallbackFilterIteratorを試してみる | |
class U { | |
public static function H($data, $default = null) { | |
if (isset($data)) { | |
return htmlspecialchars($data, ENT_QUOTES, 'UTF-8'); | |
} | |
return $default; |