@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | const USERAGENT = 'Jodel/4.48.0 Dalvik/2.1.0 (Linux; U; Android 5.1.1; )'; |
| 10 | 10 | const CLIENT_TYPE = 'android_4.48.0'; |
| 11 | 11 | |
| 12 | - private $accessToken = null; |
|
| 12 | + private $accessToken = NULL; |
|
| 13 | 13 | private $payLoad; |
| 14 | 14 | public $expects = ''; |
| 15 | 15 | public $version = 'v2'; |
@@ -76,15 +76,15 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | switch ($result->status_code) { |
| 78 | 78 | case 200: |
| 79 | - $result = json_decode($result->body, true); |
|
| 79 | + $result = json_decode($result->body, TRUE); |
|
| 80 | 80 | break; |
| 81 | 81 | case 204: |
| 82 | 82 | $result = 'Success'; |
| 83 | 83 | http_response_code(200); |
| 84 | 84 | break; |
| 85 | 85 | case 400: |
| 86 | - $result = json_decode($result->body, true); |
|
| 87 | - error_log('Error 400 - ' . print_r($result, true)); |
|
| 86 | + $result = json_decode($result->body, TRUE); |
|
| 87 | + error_log('Error 400 - ' . print_r($result, TRUE)); |
|
| 88 | 88 | break; |
| 89 | 89 | case 401: |
| 90 | 90 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | } |
| 95 | 95 | else |
| 96 | 96 | { |
| 97 | - $result = json_decode($result->body, true); |
|
| 97 | + $result = json_decode($result->body, TRUE); |
|
| 98 | 98 | |
| 99 | 99 | if(is_array($result) && $result['error'] == 'length') |
| 100 | 100 | { |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | } |
| 103 | 103 | else |
| 104 | 104 | { |
| 105 | - error_log('Error 401 - ' . print_r($result, true)); |
|
| 105 | + error_log('Error 401 - ' . print_r($result, TRUE)); |
|
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | |
@@ -111,8 +111,8 @@ discard block |
||
| 111 | 111 | case 404: |
| 112 | 112 | |
| 113 | 113 | |
| 114 | - error_log('Error 404 - ' . print_r($result, true)); |
|
| 115 | - $result = json_decode($result->body, true); |
|
| 114 | + error_log('Error 404 - ' . print_r($result, TRUE)); |
|
| 115 | + $result = json_decode($result->body, TRUE); |
|
| 116 | 116 | |
| 117 | 117 | if(array_key_exists('error', $result) && $result['error'] == 'post_blocked') |
| 118 | 118 | { |
@@ -123,25 +123,25 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | break; |
| 125 | 125 | case 477: |
| 126 | - $result = json_decode($result->body, true); |
|
| 127 | - error_log('Error 477 - ' . print_r($result, true)); |
|
| 126 | + $result = json_decode($result->body, TRUE); |
|
| 127 | + error_log('Error 477 - ' . print_r($result, TRUE)); |
|
| 128 | 128 | break; |
| 129 | 129 | case 429: |
| 130 | - error_log('Error 429 - Too Many Requests' . print_r(json_decode($result->body, true), true)); |
|
| 130 | + error_log('Error 429 - Too Many Requests' . print_r(json_decode($result->body, TRUE), TRUE)); |
|
| 131 | 131 | exit("Error 429: Too Many Requests"); |
| 132 | 132 | break; |
| 133 | 133 | case 403: |
| 134 | - error_log('Error 403 - Access denied:' . print_r(json_decode($result->body, true), true)); |
|
| 135 | - $result = json_decode($result->body, true); |
|
| 134 | + error_log('Error 403 - Access denied:' . print_r(json_decode($result->body, TRUE), TRUE)); |
|
| 135 | + $result = json_decode($result->body, TRUE); |
|
| 136 | 136 | break; |
| 137 | 137 | case 502: |
| 138 | - error_log('Error 502 - ' . print_r($result, true)); |
|
| 139 | - $result = json_decode($result->body, true); |
|
| 138 | + error_log('Error 502 - ' . print_r($result, TRUE)); |
|
| 139 | + $result = json_decode($result->body, TRUE); |
|
| 140 | 140 | header('location:'.$_SERVER['PHP_SELF']); |
| 141 | 141 | break; |
| 142 | 142 | case 503: |
| 143 | - error_log('Error 503 - ' . print_r($result, true)); |
|
| 144 | - $result = json_decode($result->body, true); |
|
| 143 | + error_log('Error 503 - ' . print_r($result, TRUE)); |
|
| 144 | + $result = json_decode($result->body, TRUE); |
|
| 145 | 145 | |
| 146 | 146 | if(array_key_exists('error', $result) && $result['error'] == 'Service Unavailable') |
| 147 | 147 | { |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | break; |
| 151 | 151 | default: |
| 152 | 152 | error_log('Error '.$result->status_code.' - unknown error'); |
| 153 | - $result = json_decode($result->body, true); |
|
| 153 | + $result = json_decode($result->body, TRUE); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | //important for account refresh |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | */ |
| 175 | 175 | private function getSignHeaders() |
| 176 | 176 | { |
| 177 | - if($this->getAccessToken() == null) { |
|
| 177 | + if($this->getAccessToken() == NULL) { |
|
| 178 | 178 | $payload_accessToken = ""; |
| 179 | 179 | } |
| 180 | 180 | else { |