Skip to content

Commit

Permalink
fixed request url bug
Browse files Browse the repository at this point in the history
  • Loading branch information
shakee93 committed Mar 24, 2017
1 parent 123ea2b commit bf40cc3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Created by .ignore support plugin (hsz.mobi)
.idea/
9 changes: 7 additions & 2 deletions fonoapi-v1.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Class fonoApi v1
* Author @shakee93
* Version 1.0.2
* Version 1.0.3
*/

class fonoApi
Expand Down Expand Up @@ -88,7 +88,12 @@ static function sendPostData($url, $post){

try {

$rUrl = "http".(!empty($_SERVER['HTTPS'])?"s":""). "://" .$_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$rUrl = null;

if (isset($_SERVER['HTTP_HOST']) && $_SERVER['REQUEST_URI']) {
$rUrl = "http".(!empty($_SERVER['HTTPS'])?"s":""). "://" .$_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
}

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
Expand Down

0 comments on commit bf40cc3

Please sign in to comment.