Open crossan007 opened 7 years ago
we're using a custom, legacy FilterInput implementation: https://github.com/ChurchCRM/CRM/blob/master/src/Include/Functions.php#L314
PHP 5.2 and lower did not include the Filter extension by default, but all current versions should include it by default.
Validation: http://php.net/manual/en/filter.examples.validation.php Sanitization: http://php.net/manual/en/filter.examples.sanitization.php
explore Propel / Symphony validators: http://symfony.com/doc/current/validation.html and http://propelorm.org/documentation/behaviors/validate.html
@benbankes - may I solicit your professional expertise here - specifically as relating to #2296
@crossan007 I don't have any experience with validation in Propel. My introduction to input validation was with other tools that haven't caused me enough pain to switch yet. As I would bet you are aware, just because Propel is being used, this doesn't mean that prepared statements are being used everywhere. For example https://github.com/ChurchCRM/CRM/blob/master/src/CSVCreateFile.php#L169 It looks like it is going to take a long time to ensure that all queries are using prepared statements before removing mysqli_real_escape_string
from FilterInput()
, but it also looks like it's necessary to do so from #2296
I'm thinking we could add a parameter to the FilterInput
function call "SkipMysqliEscape." Default to false for full backward compatibility, but in places where we're filtering input that's being passed into Propel, we would just have to remember to ask FilterInput
to skip the mysql escape.
And yes, I'm aware that there are many places where legacy queries are being executed.
@DawoudIO and I have been working on moving all legacy / direct queries to the Propel model.
It's a work in progress :-)
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
Can you give an example