From: Brion Vibber Date: Sun, 25 May 2003 00:11:24 +0000 (+0000) Subject: Use proper escaping for title-URLs; also support namespaces; also support recentchagn... X-Git-Tag: 1.1.0~518 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22auteur_infos%22%2C%20%22id_auteur=%24id%22%29%20.%20%22?a=commitdiff_plain;h=48dbdd77c80b9ffd602b539a50667619d8083600;p=lhc%2Fweb%2Fwiklou.git Use proper escaping for title-URLs; also support namespaces; also support recentchagnes table --- diff --git a/includes/SpecialAsksql.php b/includes/SpecialAsksql.php index edddd06297..34403c389c 100644 --- a/includes/SpecialAsksql.php +++ b/includes/SpecialAsksql.php @@ -54,7 +54,7 @@ class SqlQueryForm { function doSubmit() { - global $wgOut, $wgUser, $wgServer, $wgScript, $wgArticlePath; + global $wgOut, $wgUser, $wgServer, $wgScript, $wgArticlePath, $wgLang; global $wpSqlQuery; global $wgDBsqluser, $wgDBsqlpassword; @@ -91,9 +91,13 @@ class SqlQueryForm { $r .= ""; foreach ( $k as $x ) { $o = $y->$x ; - if ( $x == "cur_title" or $x == "old_title" ) { - $o = str_replace ( "$1" , rawurlencode( $o ) , $wgArticlePath ) ; - $o = "" . + 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 = $wgLang->getNsText( $namespace ) . ":" . $o; + $o = "" . htmlspecialchars( $y->$x ) . "" ; } else { $o = htmlspecialchars( $o );