-
Notifications
You must be signed in to change notification settings - Fork 39
Filter
Anton edited this page Jan 25, 2014
·
8 revisions
Удобная проверялка входных данных
Класс для зачистки данных при выводе
Предположение!:
- http://www.php.net/manual/en/filter.examples.validation.php
- http://www.php.net/manual/en/filter.examples.sanitization.php
<?php
Validate::isEmail($_POST['email']);
Sanitize::asEmail($_POST['email']);
Экранирование данных:
$foo = new stdClass();
$foo->bar = "<script>alert(123)</script>";
$foo = new Sanitize($foo);
echo $foo->bar; // <script>alert(123)</script>
$foo = new stdClass();
$foo->bar = "<script>alert(123)</script>";
$foo->foo = "<script>alert(456)</script>";
foreach (new Sanitize($foo) as $field);
echo $field; // <script>alert(123)</script>
$foo = new stdClass();
$foo->bar = "<script>alert(123)</script>";
$foo->foo = "<script>alert(456)</script>";
$this->foreach($foo, funciton($key, $value){
echo $key;
echo $value; // <script>alert(123)</script>
});
Acl
Application
Auth
Cache
Common
— Exception
— Collection
— Container
— Helper
— Options
— Singleton
Config
Controller
— Data
— Mapper
—— Crud
—— Rest
— Reflection
Crud
— Crud Table
Db
— Row
— Table
— Relations
— Query
Debug
EventManager
Grid
Http
Layout
Logger
Mailer
Messages
Nil
Proxy
Registry
Request
Response
Router
Session
Translator
Validator
View