Skip to content

Commit

Permalink
BUGFIX Consistently using Convert::raw2sql() instead of DB::getConn()…
Browse files Browse the repository at this point in the history
…->addslashes() or PHP's deprecated addslashes() for database escaping
  • Loading branch information
chillu committed Sep 15, 2011
1 parent aefda19 commit ad88e28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/search/AdvancedSearchForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function getResults($numPerPage = 10) {
foreach($_REQUEST['OnlyShow'] as $section => $checked) {
$items = explode(",", $section);
foreach($items as $item) {
$page = DataObject::get_one('SiteTree', "\"URLSegment\" = '" . DB::getConn()->addslashes($item) . "'");
$page = DataObject::get_one('SiteTree', "\"URLSegment\" = '" . Convert::raw2sql($item) . "'");
$pageList[] = $page->ID;
if(!$page) user_error("Can't find a page called '$item'", E_USER_WARNING);
$page->loadDescendantIDListInto($pageList);
Expand Down

0 comments on commit ad88e28

Please sign in to comment.