r20758 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r20757‎ | r20758 | r20759 >
Date:01:16, 28 March 2007
Author:aaron
Status:old
Tags:
Comment:
*Don't embed $ns from string, for NS 0 it becomes '' and can break the query
Modified paths:
  • /trunk/phase3/includes/SpecialLog.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialLog.php
@@ -131,10 +131,10 @@
132132 $ns = $title->getNamespace();
133133 if ( $pattern && !$wgMiserMode ) {
134134 $safetitle = $this->db->escapeLike( $title->getDBkey() ); // use escapeLike to avoid expensive search patterns like 't%st%'
135 - $this->whereClauses[] = "log_namespace=$ns AND log_title LIKE '$safetitle%'";
 135+ $this->whereClauses[] = "log_namespace=".$ns." AND log_title LIKE '$safetitle%'";
136136 } else {
137137 $safetitle = $this->db->strencode( $title->getDBkey() );
138 - $this->whereClauses[] = "log_namespace=$ns AND log_title = '$safetitle'";
 138+ $this->whereClauses[] = "log_namespace=".$ns." AND log_title = '$safetitle'";
139139 }
140140 }
141141