Index: trunk/phase3/includes/api/ApiQueryBase.php |
— | — | @@ -319,14 +319,13 @@ |
320 | 320 | } |
321 | 321 | |
322 | 322 | /** |
323 | | - * This is a very simplistic utility function |
324 | | - * to convert a non-namespaced title string to a db key. |
325 | | - * It will replace all ' ' with '_' |
| 323 | + * Convert a title to a DB key |
326 | 324 | * @param string $title Page title with spaces |
327 | 325 | * @return string Page title with underscores |
328 | 326 | */ |
329 | 327 | public static function titleToKey($title) { |
330 | | - return str_replace(' ', '_', $title); |
| 328 | + $t = Title::newFromText($title); |
| 329 | + return $t->getDbKey(); |
331 | 330 | } |
332 | 331 | |
333 | 332 | /** |
— | — | @@ -335,7 +334,8 @@ |
336 | 335 | * @return string Page title with spaces |
337 | 336 | */ |
338 | 337 | public static function keyToTitle($key) { |
339 | | - return str_replace('_', ' ', $key); |
| 338 | + $t = Title::newFromDbKey($key); |
| 339 | + return $t->getPrefixedText(); |
340 | 340 | } |
341 | 341 | |
342 | 342 | /** |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -469,6 +469,7 @@ |
470 | 470 | * Added nocreate parameter to action=edit |
471 | 471 | * (bug 14402) Added maxage and smaxage parameters to api.php |
472 | 472 | * Added bkip parameter to list=blocks |
| 473 | +* (bug 14651) apprefix and similar parameters are now canonicalized |
473 | 474 | |
474 | 475 | === Languages updated in 1.13 === |
475 | 476 | |