* Remove deprecated wfLocalUrlE() call.
authorBrion Vibber <brion@users.mediawiki.org>
Sat, 2 Oct 2004 02:43:27 +0000 (02:43 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sat, 2 Oct 2004 02:43:27 +0000 (02:43 +0000)
* Avoid notice about missing field when no namespace in result set

includes/SpecialAsksql.php

index 1876d81..666030b 100644 (file)
@@ -156,15 +156,15 @@ class SqlQueryForm {
                                                $o = $y->$x ;
                                                if ( $x == "cur_title" or $x == "old_title" or $x == "rc_title") {
                                                        $namespace = 0;
-                                                       if( $x == "cur_title" ) $namespace = $y->cur_namespace;
-                                                       if( $x == "old_title" ) $namespace = $y->old_namespace;
-                                                       if( $x == "rc_title" ) $namespace = $y->rc_namespace;
-                                                       if( $namespace ) $o = $wgContLang->getNsText( $namespace ) . ":" . $o;
-                                                       $o = "<a href=\"" . wfLocalUrlE($o) . "\" class='internal'>" .
+                                                       if( $x == "cur_title" && isset( $y->cur_namespace ) ) $namespace = $y->cur_namespace;
+                                                       if( $x == "old_title" && isset( $y->old_namespace ) ) $namespace = $y->old_namespace;
+                                                       if( $x == "rc_title" && isset( $y->rc_namespace ) ) $namespace = $y->rc_namespace;
+                                                       $title =& Title::makeTitle( $namespace, $o );
+                                                       $o = "<a href=\"" . $title->escapeLocalUrl() . "\" class='internal'>" .
                                                          htmlspecialchars( $y->$x ) . "</a>" ;
-                                                       } else {
+                                               } else {
                                                        $o = htmlspecialchars( $o );
-                                                       }
+                                               }
                                                $r .= "<td>" . $o . "</td>\n";
                                        }
                                        $r .= "</tr>\n";