Skip to content

Commit

Permalink
Merge pull request #29 from haseebq/patch-1
Browse files Browse the repository at this point in the history
Fixed: Non-ASCII chars caused the script to fail
  • Loading branch information
bdrister committed Apr 3, 2013
2 parents c065899 + 89f3a62 commit 96d9f92
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Source/PHP/AquaticPrime.php
Expand Up @@ -120,8 +120,16 @@ function getSignature($dict, $key, $privKey)

// Escape apostrophes by un-quoting, adding apos, then re-quoting
// so this turns ' into '\'' ... we have to double-slash for this php.

// Switch to UTF8 before otherwise escapeshellarg will strip out non-ASCII characters
$oldlocale = setlocale(LC_CTYPE, 0);
setlocale(LC_CTYPE, "en_US.UTF-8");

$fixedApostrophes = escapeshellarg($total);

// restore localte
setlocale(LC_CTYPE, $oldlocale);

// This part is the most expensive below
// We try to do it with native code first
$aquatic_root = preg_replace('!((/[A-Za-z._-]+)+)/AquaticPrime\.php!', '$1', __FILE__);
Expand Down Expand Up @@ -226,4 +234,4 @@ function sendMail($to, $from, $subject, $message, $license, $name, $bcc='')
mail($to, $subject, "", utf8_encode($headers));
}

?>
?>

0 comments on commit 96d9f92

Please sign in to comment.