diff options
author | Dries Buytaert <dries@buytaert.net> | 2006-03-03 08:46:09 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2006-03-03 08:46:09 +0000 |
commit | 47cf9dd9fbb930ad2238ae131ae0fef60ce27a74 (patch) | |
tree | 648a694fdc92ce2dd15bc2d57bb907e65c7d83d0 | |
parent | d7e9371e94be34b90c72bd51d56fc239237318d5 (diff) | |
download | brdo-47cf9dd9fbb930ad2238ae131ae0fef60ce27a74.tar.gz brdo-47cf9dd9fbb930ad2238ae131ae0fef60ce27a74.tar.bz2 |
- Patch #46746 by Matt: fixed inconsistent encoding of path aliases. Fixes broken URLs on profile pages.
-rw-r--r-- | database/updates.inc | 9 | ||||
-rw-r--r-- | modules/path.module | 2 | ||||
-rw-r--r-- | modules/path/path.module | 2 | ||||
-rw-r--r-- | modules/profile.module | 2 | ||||
-rw-r--r-- | modules/profile/profile.module | 2 |
5 files changed, 15 insertions, 2 deletions
diff --git a/database/updates.inc b/database/updates.inc index c4812c45a..07774956a 100644 --- a/database/updates.inc +++ b/database/updates.inc @@ -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); + } +} diff --git a/modules/path.module b/modules/path.module index cce40f470..d93ca5cef 100644 --- a/modules/path.module +++ b/modules/path.module @@ -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: diff --git a/modules/path/path.module b/modules/path/path.module index cce40f470..d93ca5cef 100644 --- a/modules/path/path.module +++ b/modules/path/path.module @@ -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: diff --git a/modules/profile.module b/modules/profile.module index 8d9655657..34fbb55f0 100644 --- a/modules/profile.module +++ b/modules/profile.module @@ -665,7 +665,7 @@ Unless you know what you are doing, it is highly recommended that you prefix the $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 { diff --git a/modules/profile/profile.module b/modules/profile/profile.module index 8d9655657..34fbb55f0 100644 --- a/modules/profile/profile.module +++ b/modules/profile/profile.module @@ -665,7 +665,7 @@ Unless you know what you are doing, it is highly recommended that you prefix the $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 { |