Skip to content

Commit

Permalink
! Should probably account for backslashes in paths. (import.php)
Browse files Browse the repository at this point in the history
* Details. (import.php)

Signed-off-by: Nao <nao@wedge>
  • Loading branch information
Nao committed Apr 5, 2014
1 parent aad30be commit 1f3c70f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions import.php
Expand Up @@ -111,14 +111,14 @@ public function __construct()
elseif (isset($_SESSION['import_db_pass']))
$_POST['db_pass'] = $_SESSION['import_db_pass'];

if (isset($_SESSION['import_paths']) && !isset($_POST['path_from']) && !isset($_POST['path_to']))
if (isset($_SESSION['import_paths']) && !isset($_POST['path_from'], $_POST['path_to']))
list ($_POST['path_from'], $_POST['path_to']) = $_SESSION['import_paths'];
elseif (isset($_POST['path_from']) || isset($_POST['path_to']))
{
if (isset($_POST['path_from']))
$_POST['path_from'] = rtrim($_POST['path_from'], '/');
$_POST['path_from'] = rtrim($_POST['path_from'], '/\\');
if (isset($_POST['path_to']))
$_POST['path_to'] = rtrim($_POST['path_to'], '/');
$_POST['path_to'] = rtrim($_POST['path_to'], '/\\');

$_SESSION['import_paths'] = array(@$_POST['path_from'], @$_POST['path_to']);
}
Expand All @@ -137,7 +137,7 @@ private function preparse_xml($file)
try
{
if (!$this->xml = simplexml_load_file($file, 'SimpleXMLElement', LIBXML_NOCDATA))
throw new import_exception('XML-Syntax error in file: ' . $file);
throw new import_exception('XML syntax error in file: ' . $file);

$this->xml = simplexml_load_file($file, 'SimpleXMLElement', LIBXML_NOCDATA);
}
Expand Down Expand Up @@ -486,7 +486,7 @@ public function doStep0($error_message = null, $object = false)
if ($this->detect_scripts())
return true;

// If these aren't set (from an error..) default to the current directory.
// If these aren't set (from an error..?), default to the current directory.
if (!isset($_POST['path_from']))
$_POST['path_from'] = dirname(__FILE__);
if (!isset($_POST['path_to']))
Expand Down

0 comments on commit 1f3c70f

Please sign in to comment.