Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't try to catch all requests when replacing URLs by permalinks.

  • Loading branch information...
commit 310562e8c1febcfc32bcdbd6ee7de34051b4e20d 1 parent 647c6ec
@kdeldycke authored
Showing with 7 additions and 2 deletions.
  1. +1 −1  e107-importer.php
  2. +6 −1 e107-redirector.php
View
2  e107-importer.php
@@ -1499,7 +1499,7 @@ function permalink_update($content) {
$tag_list = $this->extract_html_tags($new_content, $tag_name, array('http', 'https'));
foreach ($tag_list as $tag) {
$url = $tag['attributes'][$tag_attribute];
- $permalink = e107_Redirector::translate_url($url);
+ $permalink = e107_Redirector::translate_url($url, $catch_all=False);
if ($permalink != False)
$new_content = str_replace($url, $permalink, $new_content);
}
View
7 e107-redirector.php
@@ -116,7 +116,7 @@ function update_mapping($name, $data) {
// Parse an e107 URL and return its new destination according the data found in the mappings
- function translate_url($url) {
+ function translate_url($url, $catch_all = True) {
// Associate each mapping with their related regexp
$redirect_rules = array(
array( 'type' => 'post'
@@ -322,6 +322,11 @@ function translate_url($url) {
}
}
+ // Don't try to catch all requests
+ if (!$catch_all) {
+ return False;
+ }
+
// Generic redirects and catch-alls
// Redirect to the WordPress home page
Please sign in to comment.
Something went wrong with that request. Please try again.