Skip to content
This repository was archived by the owner on Mar 17, 2024. It is now read-only.

Commit

Permalink
Bugfix LEOrder
Browse files Browse the repository at this point in the history
Fixed the incorrect usage of $orderURL in LEOrder
  • Loading branch information
yourivw committed Feb 16, 2018
1 parent 9a940c0 commit c1f6160
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions LEClient/src/LEOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class LEOrder
private $keysDir;
private $basename;
private $orderDir;
private $orderURL;

public $status;
public $expires;
Expand Down Expand Up @@ -76,10 +77,10 @@ public function __construct($connector, $log, $keysDir, $basename, $domains, $no

if(file_exists($this->orderDir) AND file_exists($this->orderDir . 'private.pem') AND file_exists($this->orderDir . 'public.pem') AND file_exists($this->orderDir . 'order'))
{
$orderURL = file_get_contents($this->orderDir . '/order');
if (filter_var($orderURL, FILTER_VALIDATE_URL))
$this->orderURL = file_get_contents($this->orderDir . '/order');
if (filter_var($this->orderURL, FILTER_VALIDATE_URL))
{
$get = $this->connector->get($orderURL);
$get = $this->connector->get($this->orderURL);
if(strpos($get['header'], "200 OK") !== false)
{
$orderdomains = array_map(function($ident) { return $ident['value']; }, $get['body']['identifiers']);
Expand Down Expand Up @@ -150,7 +151,8 @@ private function createOrder($domains, $notBefore, $notAfter)
{
if(preg_match('~Location: (\S+)~i', $post['header'], $matches))
{
file_put_contents($this->orderDir . 'order', trim($matches[1]));
$this->orderURL = trim($matches[1])
file_put_contents($this->orderDir . 'order', $this->orderURL);
LEFunctions::RSAgenerateKeys($this->orderDir);

$this->status = $post['body']['status'];
Expand Down Expand Up @@ -184,7 +186,7 @@ private function createOrder($domains, $notBefore, $notAfter)
*/
private function updateOrderData()
{
$get = $this->connector->get($orderURL);
$get = $this->connector->get($this->orderURL);
if(strpos($get['header'], "200 OK") !== false)
{
$this->status = $get['body']['status'];
Expand Down

0 comments on commit c1f6160

Please sign in to comment.