Skip to content

Commit

Permalink
! Fixing infamous bug in importer script where From paths were marked…
Browse files Browse the repository at this point in the history
… as invalid even though they shouldn't be. (import.php)

@ Note 1: this was due to XML settings not being loaded at the time the HTML headers were printed. I fixed it by transparently redirecting. The problem only happened if you had only one *_to_wedge.xml file in your root folder, and could be fixed by simply refreshing the page.

@ Note 2: I'm totally manipulating the commit date for this (which is really made on April 6)... Don't want to go back to playing with github's "longest streak" (committing every day when you don't always have something to commit is annoying), and I'm artifically stopping it at 100 days. Should give me about 265 days of tranquility, at which point GH may have allowed users to hide that annoying stat.

Signed-off-by: Nao <nao@wedge>
  • Loading branch information
Nao committed Apr 4, 2014
1 parent ebc715a commit aad30be
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions import.php
Expand Up @@ -196,10 +196,8 @@ private function detect_scripts()

if (count($scripts) == 1)
{
$_SESSION['import_script'] = basename($scripts[0]['path']);
if (substr($_SESSION['import_script'], -4) == '.xml')
$this->preparse_xml(dirname(__FILE__) . '/' . $_SESSION['import_script']);
return false;
header('Location: ' . $_SERVER['PHP_SELF'] . '?import_script=' . basename($scripts[0]['path']));
exit;
}

$template->select_script($scripts);
Expand Down

0 comments on commit aad30be

Please sign in to comment.