Comments (5)
Hi Brunoti,
There is no point in sanitizing an empty string or array, and because the main purpose of the Sanitization library is to be used with input coming from HTML forms, no null values are expected (and therefore a null value check would be of little value).
I'm sorry but we can't make this change at this time, you are free to fork the project if you feel this is a mistake though.
Best!
from sanitizer.
Thanks for the feedback! You are right.
But what about the ideia of transform the empty string in null? Or casting numbers and booleans?
You think that this is not a job for the sanitizer?
from sanitizer.
@brunoti we've implemented the changes you asked for. I just pushed v1.0.5 with no is_empty check and a new filter called 'cast'.
from sanitizer.
Thanks @sildraug! Me and my coworkers are very happy to use this lib.
Cheers!
from sanitizer.
I think this error appeared again in version 1.0.11 :(
Example code generating issue (filter-text index not found - because sanitizer returns null)
It worked from 1.0.5 till 1.0.10
$cleaned = \Sanitizer::make($request->all(), ['filter-text' => 'trim|strip_tags'])->sanitize();
}
$filterName = preg_replace('/[^a-zA-Z0 -]/u', ' ', $cleaned['filter-text']);
from sanitizer.
Related Issues (20)
- I would like to use some kind of "stripTags" function HOT 3
- Laravel 5.6 breaks the current version of the package
- Laravel 5.6 version HOT 1
- I do not get the filtered data back when validation succeeds. HOT 3
- Sanitize for all item in array HOT 1
- Question: It is possible to use custom filters when using SanitizesInput on my FormRequest? HOT 1
- FormRequest SanitizesInput trait adds attribute when they are not present HOT 5
- No filter found by the name of digit HOT 1
- Add a filter for sometimes rules HOT 3
- Update in packagist HOT 1
- Question: How to convert from UTF-8 general_ci ? HOT 1
- Usage in FormRequest HOT 7
- filter_if: Option? HOT 1
- Laravel 6 compatibility HOT 1
- ErrorException Illegal string offset 'name' HOT 7
- Question: is there any way of applying a sanitizer filter after validation? HOT 3
- Using the Trait wont work when using request('input_name')
- Laravel 7 compatibility
- Does not work with illuminate/validation 5.3.23 HOT 2
- Add Laravel 8 support HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sanitizer.