diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2017-07-20 23:48:13 +0300 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2017-07-20 23:48:13 +0300 |
commit | 3d2600b0399af0dd4521469725f5e4bdf348bd2e (patch) | |
tree | b231906605d82e7fe537a81a9e10299ca9beb37f /core/Command/Db/ConvertType.php | |
parent | 4826fd701dda218792b5072977b24da7d42a94fa (diff) |
Add Phan plugin to check for SQL injections
This adds a phan plugin which checks for SQL injections on code using our QueryBuilder, while it isn't perfect it should already catch most potential issues.
As always, static analysis will sometimes have false positives and this is also here the case. So in some cases the analyzer just doesn't know if something is potential user input or not, thus I had to add some `@suppress SqlInjectionChecker` in front of those potential injections.
The Phan plugin hasn't the most awesome code but it works and I also added a file with test cases.
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'core/Command/Db/ConvertType.php')
-rw-r--r-- | core/Command/Db/ConvertType.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/Command/Db/ConvertType.php b/core/Command/Db/ConvertType.php index 4ca7899fec6..16864e57dbc 100644 --- a/core/Command/Db/ConvertType.php +++ b/core/Command/Db/ConvertType.php @@ -261,6 +261,14 @@ class ConvertType extends Command implements CompletionAwareInterface { return $db->getSchemaManager()->listTableNames(); } + /** + * @param Connection $fromDB + * @param Connection $toDB + * @param $table + * @param InputInterface $input + * @param OutputInterface $output + * @suppress SqlInjectionChecker + */ protected function copyTable(Connection $fromDB, Connection $toDB, $table, InputInterface $input, OutputInterface $output) { $chunkSize = $input->getOption('chunk-size'); |