r20759 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r20758‎ | r20759 | r20760 >
Date:01:26, 28 March 2007
Author:aaron
Status:old
Tags:
Comment:
*Use intval() to stop $ns from becoming '' which breaks query
Modified paths:
  • /trunk/phase3/includes/SpecialLog.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialLog.php
@@ -128,13 +128,13 @@
129129 }
130130 $this->title =& $title;
131131 $this->pattern = $pattern;
132 - $ns = $title->getNamespace();
 132+ $ns = intval( $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