fix injection bugs in table editor
This commit is contained in:
@@ -37,23 +37,14 @@ class BladeExtensionsProvider extends ServiceProvider
|
||||
return "<?= e(app()->make('\\Faker\\Generator')->$method($params)) ?>";
|
||||
});
|
||||
|
||||
// csrf token for forms
|
||||
Blade::directive('formCsrf', function () {
|
||||
return '<?= csrf_field() ?>';
|
||||
});
|
||||
|
||||
// json encode
|
||||
Blade::directive('json', function ($x) {
|
||||
return "<?= json_encode(($x), JSON_UNESCAPED_SLASHES) ?>";
|
||||
return "<?= toJSON($x) ?>";
|
||||
});
|
||||
|
||||
// json encode, escaped
|
||||
Blade::directive('jsone', function ($x) {
|
||||
if (config('app.pretty_json')) {
|
||||
return "<?= e(json_encode(($x), JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES)) ?>";
|
||||
} else {
|
||||
return "<?= e(json_encode(($x), JSON_UNESCAPED_SLASHES)) ?>";
|
||||
}
|
||||
return "<?= e(toJSON($x)) ?>";
|
||||
});
|
||||
|
||||
// selected if cond true
|
||||
@@ -66,10 +57,6 @@ class BladeExtensionsProvider extends ServiceProvider
|
||||
return "<?= ($x) ? 'checked' : '' ?>";
|
||||
});
|
||||
|
||||
Blade::if('admin', function () {
|
||||
return \Auth::user()->isAdmin();
|
||||
});
|
||||
|
||||
Blade::if('set', function ($x) {
|
||||
return config($x) != '';
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user