diff --git a/lib/Fred.class.php b/lib/Fred.class.php index 50c793a..c97d5d4 100644 --- a/lib/Fred.class.php +++ b/lib/Fred.class.php @@ -30,7 +30,7 @@ class Fred { preg_match("`url='([^']+)'`isU", $page1, $matches); - $url = $matches[1]; + $urlipns = $matches[1]; $page2 = ''; $rounds = 0; @@ -38,7 +38,7 @@ class Fred { while (empty($page2) and $rounds < 10) { sleep($this->gatewayDelay); - $page2 = file_get_contents($url); + $page2 = file_get_contents($urlipns); } if (empty($page2)) { @@ -62,11 +62,7 @@ class Fred { $query = 'salt='. $salt .'&pepper='. $pepper . '&messaging=' . $gchangeName; - $url = $this->gatewayProtocol . '://'. $this->gatewayDomain .':' . $this->gatewayPort . '/?' . $query; - - // echo '
'; var_dump(htmlspecialchars($url)); echo '
'; - - $page1 = file_get_contents($url); + $page1 = file_get_contents($this->gatewayProtocol . '://'. $this->gatewayDomain .':' . $this->gatewayPort . '/?' . $query); if (empty($page1)) { @@ -77,9 +73,9 @@ class Fred { preg_match("`url='([^']+)'`isU", $page1, $matches); - $url = $matches[1]; + $urlmessages = $matches[1]; - // echo '
'; var_dump($url); echo '
'; + // echo '
'; var_dump($urli); echo '
'; $page2 = ''; $rounds = 0; @@ -87,7 +83,7 @@ class Fred { while (empty($page2) and $rounds < 10) { sleep($this->gatewayDelay); - $page2 = file_get_contents($url); + $page2 = file_get_contents($urlmessages); } if (empty($page2)) { @@ -111,9 +107,9 @@ class Fred { $query = 'salt='. urlencode($salt) .'&pepper='. urlencode($pepper) . '&getg1pub=yes'; - $url = $this->gatewayProtocol . '://'. $this->gatewayDomain .':' . $this->gatewayPort . '/?' . $query; + $urlj = $this->gatewayProtocol . '://'. $this->gatewayDomain .':' . $this->gatewayPort . '/?' . $query; - // echo '
'; var_dump(htmlspecialchars($url)); echo '
'; + // echo '
'; var_dump(htmlspecialchars($urlj)); echo '
'; $opts = array( 'http'=>array( @@ -125,7 +121,7 @@ class Fred { $context = stream_context_create($opts); - $page1 = file_get_contents($url, false, $context); + $page1 = file_get_contents($urlj, false, $context); if (empty($page1)) { @@ -142,7 +138,7 @@ class Fred { // '
' . print_r($matches, true) . '
' // ); - $url = $matches[1]; + $urlg1pub = $matches[1]; $page2 = ''; $rounds = 0; @@ -150,7 +146,7 @@ class Fred { while (empty($page2) and $rounds < 10) { sleep($this->gatewayDelay); - $page2 = file_get_contents($url); + $page2 = file_get_contents($urlg1pub); } if (empty($page2)) {