r70165 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70164‎ | r70165 | r70166 >
Date:19:02, 29 July 2010
Author:maxsem
Status:ok
Tags:
Comment:
CodeReview: SQLite compatibility++. Now it builds LIKE queries using nice, portable and safe buildLike()
Modified paths:
  • /trunk/extensions/CodeReview/backend/CodeRevision.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeReleaseNotes.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeRevisionListView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/backend/CodeRevision.php
@@ -689,7 +689,7 @@
690690 $dbr = wfGetDB( DB_SLAVE );
691691 return array(
692692 'cp_repo_id' => $this->mRepoId,
693 - 'cp_path LIKE ' . $dbr->addQuotes( $dbr->escapeLike( $path ) . '%' ),
 693+ 'cp_path ' . $dbr->buildLike( $path, $dbr->anyString() ),
694694 // performance
695695 'cp_rev_id > ' . ( $this->mRepo->getLastStoredRev() - 20000 ),
696696 // join conds
Index: trunk/extensions/CodeReview/ui/CodeRevisionListView.php
@@ -235,7 +235,7 @@
236236 'fields' => $this->getSelectFields(),
237237 'conds' => array(
238238 'cp_repo_id' => $this->mRepo->getId(),
239 - 'cp_path LIKE ' . $this->mDb->addQuotes( $this->mDb->escapeLike( $this->getSVNPath() ) . '%' ),
 239+ 'cp_path ' . $this->mDb->buildLike( $this->getSVNPath(), $this->mDb->anyString() ),
240240 // performance
241241 'cp_rev_id > ' . ( $this->mRepo->getLastStoredRev() - 20000 )
242242 ),
Index: trunk/extensions/CodeReview/ui/CodeReleaseNotes.php
@@ -66,7 +66,7 @@
6767 $where = 'cr_id >= ' . intval( $this->mStartRev );
6868 }
6969 if ( $this->mPath ) {
70 - $where .= ' AND (cr_path LIKE ' . $dbr->addQuotes( $dbr->escapeLike( "{$this->mPath}/" ) . '%' );
 70+ $where .= ' AND (cr_path ' . $dbr->buildLike( "{$this->mPath}/", $dbr->anyString() );
7171 $where .= ' OR cr_path = ' . $dbr->addQuotes( $this->mPath ) . ')';
7272 }
7373 # Select commits within this range...

Status & tagging log