* Added nocreate parameter to action=edit
* (bug 14402) Added maxage and smaxage parameters to api.php
* Added bkip parameter to list=blocks
+* (bug 14651) apprefix and similar parameters are now canonicalized
=== Languages updated in 1.13 ===
}
/**
- * This is a very simplistic utility function
- * to convert a non-namespaced title string to a db key.
- * It will replace all ' ' with '_'
+ * Convert a title to a DB key
* @param string $title Page title with spaces
* @return string Page title with underscores
*/
public static function titleToKey($title) {
- return str_replace(' ', '_', $title);
+ $t = Title::newFromText($title);
+ return $t->getDbKey();
}
/**
* @return string Page title with spaces
*/
public static function keyToTitle($key) {
- return str_replace('_', ' ', $key);
+ $t = Title::newFromDbKey($key);
+ return $t->getPrefixedText();
}
/**