Skip to content

Commit

Permalink
[SS-2018-020] Ensure that table names are escaped to prevent possible…
Browse files Browse the repository at this point in the history
… SQL injection
  • Loading branch information
robbieaverill authored and Aaron Carlino committed Dec 11, 2018
1 parent 6edcbe9 commit 48bd335
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ORM/DataObjectSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use SilverStripe\Core\ClassInfo;
use SilverStripe\Core\Config\Config;
use SilverStripe\Core\Config\Configurable;
use SilverStripe\Core\Convert;
use SilverStripe\Core\Injector\Injectable;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Dev\TestOnly;
Expand Down Expand Up @@ -125,7 +126,7 @@ public function tableName($class)
$tables = $this->getTableNames();
$class = ClassInfo::class_name($class);
if (isset($tables[$class])) {
return $tables[$class];
return Convert::raw2sql($tables[$class]);
}
return null;
}
Expand Down

0 comments on commit 48bd335

Please sign in to comment.