Skip to content

Commit

Permalink
BUGFIX: Use correct quoting for BrokenLinksReport (ticket #5474)
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@103706 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information
lingo authored and Sam Minnee committed Feb 2, 2011
1 parent 07d182a commit 19b2718
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions code/reports/BrokenLinksReport.php
Expand Up @@ -29,9 +29,9 @@ function sourceRecords($params, $sort, $limit) {
$sort = '';
}
}

if (!isset($_REQUEST['CheckSite']) || $params['CheckSite'] == 'Published') $ret = Versioned::get_by_stage('SiteTree', 'Live', "(HasBrokenLink = 1 OR HasBrokenFile = 1)", $sort, $join, $limit);
else $ret = DataObject::get('SiteTree', "(HasBrokenFile = 1 OR HasBrokenLink = 1)", $sort, $join, $limit);
$q = DB::USE_ANSI_SQL ? '"' : '`';
if (!isset($_REQUEST['CheckSite']) || $params['CheckSite'] == 'Published') $ret = Versioned::get_by_stage('SiteTree', 'Live', "({$q}SiteTree{$q}.{$q}HasBrokenLink{$q} = 1 OR {$q}SiteTree{$q}.{$q}HasBrokenFile{$q} = 1)", $sort, $join, $limit);
else $ret = DataObject::get('SiteTree', "({$q}SiteTree{$q}.{$q}HasBrokenFile{$q} = 1 OR {$q}HasBrokenLink{$q} = 1)", $sort, $join, $limit);

$returnSet = new DataObjectSet();
if ($ret) foreach($ret as $record) {
Expand Down

0 comments on commit 19b2718

Please sign in to comment.