Index: trunk/extensions/BotQuery/query.php |
— | — | @@ -928,7 +928,7 @@ |
929 | 929 | } |
930 | 930 | |
931 | 931 | $where = array( 'page_namespace' => intval($apnamespace) ); |
932 | | - if( $apfrom !== '' ) $where[] = 'page_title>=' . $this->db->addQuotes($apfrom); |
| 932 | + if( $apfrom !== '' ) $where[] = 'page_title>=' . $this->db->addQuotes(titleToKey($apfrom)); |
933 | 933 | |
934 | 934 | if ($apfilterredir === 'redirects') |
935 | 935 | $where['page_is_redirect'] = 1; |
— | — | @@ -949,7 +949,7 @@ |
950 | 950 | while ( $row = $this->db->fetchObject( $res ) ) { |
951 | 951 | if( ++$count > $aplimit ) { |
952 | 952 | // We've reached the one extra which shows that there are additional pages to be had. Stop here... |
953 | | - $this->addStatusMessage( $prop, array('next' => $row->page_title) ); |
| 953 | + $this->addStatusMessage( $prop, array('next' => keyToTitle($row->page_title)) ); |
954 | 954 | break; |
955 | 955 | } |
956 | 956 | $this->storePageInfo( $row ); |
— | — | @@ -983,7 +983,7 @@ |
984 | 984 | . " FROM $page LEFT JOIN $langlinks ON page_id = ll_from" |
985 | 985 | . ' WHERE' |
986 | 986 | . ' ll_from IS NULL AND page_is_redirect = 0 AND page_namespace=' . intval($nlnamespace) |
987 | | - . ( $nlfrom === '' ? '' : ' AND page_title>=' . $this->db->addQuotes($nlfrom) ) |
| 987 | + . ( $nlfrom === '' ? '' : ' AND page_title>=' . $this->db->addQuotes(titleToKey($nlfrom)) ) |
988 | 988 | . ' ORDER BY page_namespace, page_title' |
989 | 989 | . ' LIMIT ' . intval($nllimit+1); |
990 | 990 | |
— | — | @@ -996,7 +996,7 @@ |
997 | 997 | while ( $row = $this->db->fetchObject( $res ) ) { |
998 | 998 | if( ++$count > $nllimit ) { |
999 | 999 | // We've reached the one extra which shows that there are additional pages to be had. Stop here... |
1000 | | - $this->addStatusMessage( $prop, array('next' => $row->page_title) ); |
| 1000 | + $this->addStatusMessage( $prop, array('next' => keyToTitle($row->page_title))); |
1001 | 1001 | break; |
1002 | 1002 | } |
1003 | 1003 | $this->storePageInfo( $row ); |
— | — | @@ -1028,7 +1028,7 @@ |
1029 | 1029 | $tables = array( 'categorylinks' ); |
1030 | 1030 | $conds = array( 'cl_to' => $categoryObj->getDBkey() ); |
1031 | 1031 | if ($cpfrom != '') |
1032 | | - $conds[] = 'cl_sortkey >= ' . $this->db->addQuotes($cpfrom); |
| 1032 | + $conds[] = 'cl_sortkey >= ' . $this->db->addQuotes(titleToKey($cpfrom)); |
1033 | 1033 | |
1034 | 1034 | if( $cpnamespace !== NS_ALL_NAMESPACES ) |
1035 | 1035 | { |
— | — | @@ -1060,7 +1060,7 @@ |
1061 | 1061 | while ( $row = $this->db->fetchObject( $res ) ) { |
1062 | 1062 | if( ++$count > $cplimit ) { |
1063 | 1063 | // We've reached the one extra which shows that there are additional pages to be had. Stop here... |
1064 | | - $this->addStatusMessage( 'category', array('next' => $row->cl_sortkey) ); |
| 1064 | + $this->addStatusMessage( 'category', array('next' => keyToTitle($row->cl_sortkey))); |
1065 | 1065 | break; |
1066 | 1066 | } |
1067 | 1067 | $this->addRaw( 'pageids', $row->cl_from ); |
— | — | @@ -2563,6 +2563,15 @@ |
2564 | 2564 | return round( $timeDelta * 1000.0, 1 ); |
2565 | 2565 | } |
2566 | 2566 | |
| 2567 | +function titleToKey($title) |
| 2568 | +{ |
| 2569 | + return str_replace(' ', '_', $title); |
| 2570 | +} |
| 2571 | +function keyToTitle($key) |
| 2572 | +{ |
| 2573 | + return str_replace('_', ' ', $key); |
| 2574 | +} |
| 2575 | + |
2567 | 2576 | /** |
2568 | 2577 | *@desc Get a parameter from the request, and validate that it contains only '-' or lower case letters |
2569 | 2578 | */ |