Skip to content
Snippets Groups Projects
Commit 47cf9dd9 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- 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
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -1659,3 +1659,12 @@ function system_update_174() { ...@@ -1659,3 +1659,12 @@ function system_update_174() {
} }
return array(); 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) { ...@@ -144,7 +144,9 @@ function path_set_alias($path = NULL, $alias = NULL, $pid = NULL) {
drupal_clear_path_cache(); drupal_clear_path_cache();
} }
else if ($path && $alias) { else if ($path && $alias) {
$path = urldecode($path);
$path_count = db_result(db_query("SELECT COUNT(src) FROM {url_alias} WHERE src = '%s'", $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)); $alias_count = db_result(db_query("SELECT COUNT(dst) FROM {url_alias} WHERE dst = '%s'", $alias));
// We have an insert: // We have an insert:
......
...@@ -144,7 +144,9 @@ function path_set_alias($path = NULL, $alias = NULL, $pid = NULL) { ...@@ -144,7 +144,9 @@ function path_set_alias($path = NULL, $alias = NULL, $pid = NULL) {
drupal_clear_path_cache(); drupal_clear_path_cache();
} }
else if ($path && $alias) { else if ($path && $alias) {
$path = urldecode($path);
$path_count = db_result(db_query("SELECT COUNT(src) FROM {url_alias} WHERE src = '%s'", $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)); $alias_count = db_result(db_query("SELECT COUNT(dst) FROM {url_alias} WHERE dst = '%s'", $alias));
// We have an insert: // We have an insert:
......
...@@ -665,7 +665,7 @@ function _profile_field_form($type, $edit = array()) { ...@@ -665,7 +665,7 @@ function _profile_field_form($type, $edit = array()) {
$form['fields']['page'] = array('#type' => 'textfield', $form['fields']['page'] = array('#type' => 'textfield',
'#title' => t('Page title'), '#title' => t('Page title'),
'#default_value' => $edit['page'], '#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 { else {
......
...@@ -665,7 +665,7 @@ function _profile_field_form($type, $edit = array()) { ...@@ -665,7 +665,7 @@ function _profile_field_form($type, $edit = array()) {
$form['fields']['page'] = array('#type' => 'textfield', $form['fields']['page'] = array('#type' => 'textfield',
'#title' => t('Page title'), '#title' => t('Page title'),
'#default_value' => $edit['page'], '#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 { else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment