- Added database validation

- Added valid date for posts
- Fix passing data to htmls conflicts
This commit is contained in:
2017-09-06 10:40:05 +07:00
parent 57dc4ca0b9
commit 71fb5e4933
8 changed files with 126 additions and 46 deletions

View File

@@ -76,7 +76,8 @@ class Router
} else {
// Token invalid
$flash = Session::flash('info', 'Token invalid, try again');
die($flash);
$error = Session::flash('info');
die($error);
}
unset($var['_token']);
unset($var['_method']);

14
Core/Validate.php Normal file
View File

@@ -0,0 +1,14 @@
<?php
namespace Core;
class Validate
{
public static function check($items)
{
foreach ($items as $item) {
$item = preg_replace('/^<[\Ww\/]>$/', '', $item);
return true;
}
return false;
}
}