Commit 47cf9dd9 authored by Dries's avatar Dries

- Patch #46746 by Matt: fixed inconsistent encoding of path aliases. Fixes...

- Patch #46746 by Matt: fixed inconsistent encoding of path aliases.  Fixes broken URLs on profile pages.
parent d7e9371e
......@@ -1659,3 +1659,12 @@ function system_update_174() {
}
return array();
}
function system_update_175() {
$result = db_query('SELECT * FROM {url_alias}');
while ($path = db_fetch_object($result)) {
$path->src = urldecode($path->src);
$path->dst = urldecode($path->dst);
db_query("UPDATE {url_alias} SET dst = '%s', src = '%s' WHERE pid = %d", $path->dst, $path->src, $path->pid);
}
}
......@@ -144,7 +144,9 @@ function path_set_alias($path = NULL, $alias = NULL, $pid = NULL) {
drupal_clear_path_cache();
}
else if ($path && $alias) {
$path = urldecode($path);
$path_count = db_result(db_query("SELECT COUNT(src) FROM {url_alias} WHERE src = '%s'", $path));
$alias = urldecode($alias);
$alias_count = db_result(db_query("SELECT COUNT(dst) FROM {url_alias} WHERE dst = '%s'", $alias));
// We have an insert:
......
......@@ -144,7 +144,9 @@ function path_set_alias($path = NULL, $alias = NULL, $pid = NULL) {
drupal_clear_path_cache();
}
else if ($path && $alias) {
$path = urldecode($path);
$path_count = db_result(db_query("SELECT COUNT(src) FROM {url_alias} WHERE src = '%s'", $path));
$alias = urldecode($alias);
$alias_count = db_result(db_query("SELECT COUNT(dst) FROM {url_alias} WHERE dst = '%s'", $alias));
// We have an insert:
......
......@@ -665,7 +665,7 @@ function _profile_field_form($type, $edit = array()) {
$form['fields']['page'] = array('#type' => 'textfield',
'#title' => t('Page title'),
'#default_value' => $edit['page'],
'#description' => t('The title of the page showing all users with the specified field. The word <code>%value</code> will be substituted with the corresponding value. An example page title is "People whose favorite color is %value". Only applicable if the field is configured to be shown on member list pages.'),
'#description' => t('The title of the page showing all users with the specified field. The word <code>%value</code> will be substituted with the corresponding value. An example page title is "People whose favorite color is %value". This is only applicable for a public field.'),
);
}
else {
......
......@@ -665,7 +665,7 @@ function _profile_field_form($type, $edit = array()) {
$form['fields']['page'] = array('#type' => 'textfield',
'#title' => t('Page title'),
'#default_value' => $edit['page'],
'#description' => t('The title of the page showing all users with the specified field. The word <code>%value</code> will be substituted with the corresponding value. An example page title is "People whose favorite color is %value". Only applicable if the field is configured to be shown on member list pages.'),
'#description' => t('The title of the page showing all users with the specified field. The word <code>%value</code> will be substituted with the corresponding value. An example page title is "People whose favorite color is %value". This is only applicable for a public field.'),
);
}
else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment