Skip to content
This repository has been archived by the owner on Apr 22, 2021. It is now read-only.

Commit

Permalink
Fix #32. Escaping numeric replacements in the content fix method to m…
Browse files Browse the repository at this point in the history
…ake it compatible with domains that start with a number, such as Tor domains.
  • Loading branch information
straube committed Dec 19, 2018
1 parent ac2a62f commit 61c65f4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ language set in the plugin config. Also notice the language may be `null`.

## Changelog

### 0.8.2

* Fix: #32 Image URLs not being re-written properly via Tor.

### 0.8.1

* Fix: #23 Undefined index when using wp-cli.
Expand Down Expand Up @@ -120,7 +124,7 @@ This is the first release. It supports setting domains and an optional base URL
Contributors: GustavoStraube, cyberaleks, jffaria
Tags: multiple, domains, redirect
Requires at least: 4.0
Tested up to: 4.9.6
Tested up to: 5.0.1
Stable tag: trunk
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
6 changes: 3 additions & 3 deletions multiple-domain/MultipleDomain.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @author Clay Allsopp <https://github.com/clayallsopp>
* @author Alexander Nosov <https://github.com/cyberaleks>
* @author João Faria <https://github.com/jffaria>
* @version 0.8.1
* @version 0.8.2
* @package multiple-domain
*/
class MultipleDomain
Expand All @@ -20,7 +20,7 @@ class MultipleDomain
* @var string
* @since 0.3
*/
const VERSION = '0.8.1';
const VERSION = '0.8.2';

/**
* The current domain.
Expand Down Expand Up @@ -348,7 +348,7 @@ public function fixContentUrls($content)
{
if (array_key_exists($this->domain, $this->domains)) {
$regex = '/(https?:\/\/)' . preg_quote($this->originalDomain) . '/i';
$content = preg_replace($regex, '$1' . $this->domain, $content);
$content = preg_replace($regex, '${1}' . $this->domain, $content);
}
return $content;
}
Expand Down
2 changes: 1 addition & 1 deletion multiple-domain/multiple-domain.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Description: This plugin allows you to have multiple domains in a single
WordPress installation and enables custom redirects for each
domain.
Version: 0.8.1
Version: 0.8.2
Author: Gustavo Straube (straube.co)
Author URI: http://straube.co
License: GPLv2 or later
Expand Down
6 changes: 5 additions & 1 deletion multiple-domain/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Contributors: GustavoStraube, cyberaleks, jffaria
Tags: multiple, domains, redirect
Requires at least: 4.0
Tested up to: 4.9.6
Tested up to: 5.0.1
Stable tag: trunk
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -69,6 +69,10 @@ language set in the plugin config. Also notice the language may be `null`.

== Changelog ==

= 0.8.2 =

* Fix: #32 Image URLs not being re-written properly via Tor.

= 0.8.1 =

* Fix: #23 Undefined index when using wp-cli.
Expand Down

0 comments on commit 61c65f4

Please sign in to comment.