Permalink
Browse files

Check that the site URL we get from e107 preferences is set properly.…

… Close ticket #6.
  • Loading branch information...
1 parent 8c08ef1 commit e5dce02367f2feb18e0fc1dae7307e45a94a61d1 @kdeldycke committed Oct 6, 2011
Showing with 6 additions and 2 deletions.
  1. +4 −0 e107-importer.php
  2. +2 −2 readme.txt
View
4 e107-importer.php
@@ -395,6 +395,10 @@ function defsettrue($str,$default='') {
// Set global SITEURL as it's used by replaceConstants() method
$site_url = $this->e107_pref['siteurl'];
+ // If the e107 site URL is not set to something we expect, raise an error
+ // Check that URL starts with "http[s]://"
+ if (!preg_match('/^https?:\/\//i', $site_url))
+ wp_die("e107's site URL must be set properly (= must start with 'http://' or 'https://').");
// Normalize URL: it must end with a single slash
define("SITEURL", rtrim($site_url, '/').'/');
View
4 readme.txt
@@ -148,8 +148,8 @@ This plugin contain original code from the e107 project, licensed under the GPL.
== Changelog ==
-= 1.5 =
-No changes yet.
+= 1.5.dev =
+* Check that the site URL we get from e107 preferences is set properly.
= 1.4 =
* Declare this plugin as unmaintained.

0 comments on commit e5dce02

Please sign in to comment.