@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | const USERAGENT = 'Jodel/4.41.0 Dalvik/2.1.0 (Linux; U; Android 5.1.1; )'; |
| 9 | 9 | const CLIENT_TYPE = 'android_4.41.0'; |
| 10 | 10 | |
| 11 | - private $accessToken = null; |
|
| 11 | + private $accessToken = NULL; |
|
| 12 | 12 | private $payLoad; |
| 13 | 13 | public $expects = ''; |
| 14 | 14 | public $version = 'v2'; |
@@ -75,18 +75,18 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | switch ($result->status_code) { |
| 77 | 77 | case 200: |
| 78 | - $result = json_decode($result->body, true); |
|
| 78 | + $result = json_decode($result->body, TRUE); |
|
| 79 | 79 | break; |
| 80 | 80 | case 204: |
| 81 | 81 | $result = 'Success'; |
| 82 | 82 | http_response_code(200); |
| 83 | 83 | break; |
| 84 | 84 | case 400: |
| 85 | - $result = json_decode($result->body, true); |
|
| 86 | - error_log('Error 400 - ' . print_r($result, true)); |
|
| 85 | + $result = json_decode($result->body, TRUE); |
|
| 86 | + error_log('Error 400 - ' . print_r($result, TRUE)); |
|
| 87 | 87 | break; |
| 88 | 88 | case 401: |
| 89 | - $result = json_decode($result->body, true); |
|
| 89 | + $result = json_decode($result->body, TRUE); |
|
| 90 | 90 | |
| 91 | 91 | if(array_key_exists('error', $result) && $result['error'] == 'length') |
| 92 | 92 | { |
@@ -94,33 +94,33 @@ discard block |
||
| 94 | 94 | } |
| 95 | 95 | else |
| 96 | 96 | { |
| 97 | - error_log('Error 401 - ' . print_r($result, true)); |
|
| 97 | + error_log('Error 401 - ' . print_r($result, TRUE)); |
|
| 98 | 98 | } |
| 99 | 99 | break; |
| 100 | 100 | case 404: |
| 101 | - error_log('Error 404 - ' . print_r($result, true)); |
|
| 102 | - $result = json_decode($result->body, true); |
|
| 101 | + error_log('Error 404 - ' . print_r($result, TRUE)); |
|
| 102 | + $result = json_decode($result->body, TRUE); |
|
| 103 | 103 | break; |
| 104 | 104 | case 477: |
| 105 | - $result = json_decode($result->body, true); |
|
| 106 | - error_log('Error 477 - ' . print_r($result, true)); |
|
| 105 | + $result = json_decode($result->body, TRUE); |
|
| 106 | + error_log('Error 477 - ' . print_r($result, TRUE)); |
|
| 107 | 107 | break; |
| 108 | 108 | case 429: |
| 109 | - error_log('Error 429 - Too Many Requests' . print_r(json_decode($result->body, true), true)); |
|
| 109 | + error_log('Error 429 - Too Many Requests' . print_r(json_decode($result->body, TRUE), TRUE)); |
|
| 110 | 110 | exit("Error 429: Too Many Requests"); |
| 111 | 111 | break; |
| 112 | 112 | case 403: |
| 113 | - error_log('Error 403 - Access denied:' . print_r(json_decode($result->body, true), true)); |
|
| 114 | - $result = json_decode($result->body, true); |
|
| 113 | + error_log('Error 403 - Access denied:' . print_r(json_decode($result->body, TRUE), TRUE)); |
|
| 114 | + $result = json_decode($result->body, TRUE); |
|
| 115 | 115 | break; |
| 116 | 116 | case 502: |
| 117 | - error_log('Error 502 - ' . print_r($result, true)); |
|
| 118 | - $result = json_decode($result->body, true); |
|
| 117 | + error_log('Error 502 - ' . print_r($result, TRUE)); |
|
| 118 | + $result = json_decode($result->body, TRUE); |
|
| 119 | 119 | header('location:'.$_SERVER['PHP_SELF']); |
| 120 | 120 | break; |
| 121 | 121 | case 503: |
| 122 | - error_log('Error 503 - ' . print_r($result, true)); |
|
| 123 | - $result = json_decode($result->body, true); |
|
| 122 | + error_log('Error 503 - ' . print_r($result, TRUE)); |
|
| 123 | + $result = json_decode($result->body, TRUE); |
|
| 124 | 124 | |
| 125 | 125 | if(array_key_exists('error', $result) && $result['error'] == 'Service Unavailable') |
| 126 | 126 | { |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | break; |
| 130 | 130 | default: |
| 131 | 131 | error_log('Error '.$result->status_code.' - unknown error'); |
| 132 | - $result = json_decode($result->body, true); |
|
| 132 | + $result = json_decode($result->body, TRUE); |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | //important for account refresh |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | */ |
| 154 | 154 | private function getSignHeaders() |
| 155 | 155 | { |
| 156 | - if($this->getAccessToken() == null) { |
|
| 156 | + if($this->getAccessToken() == NULL) { |
|
| 157 | 157 | $payload_accessToken = ""; |
| 158 | 158 | } |
| 159 | 159 | else { |