@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | const USERAGENT = 'Jodel/4.47.0 Dalvik/2.1.0 (Linux; U; Android 5.1.1; )'; |
9 | 9 | const CLIENT_TYPE = 'android_4.47.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,15 +75,15 @@ 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 | 89 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | } |
94 | 94 | else |
95 | 95 | { |
96 | - $result = json_decode($result->body, true); |
|
96 | + $result = json_decode($result->body, TRUE); |
|
97 | 97 | |
98 | 98 | if(is_array($result) && $result['error'] == 'length') |
99 | 99 | { |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | } |
102 | 102 | else |
103 | 103 | { |
104 | - error_log('Error 401 - ' . print_r($result, true)); |
|
104 | + error_log('Error 401 - ' . print_r($result, TRUE)); |
|
105 | 105 | } |
106 | 106 | } |
107 | 107 | |
@@ -110,8 +110,8 @@ discard block |
||
110 | 110 | case 404: |
111 | 111 | |
112 | 112 | |
113 | - error_log('Error 404 - ' . print_r($result, true)); |
|
114 | - $result = json_decode($result->body, true); |
|
113 | + error_log('Error 404 - ' . print_r($result, TRUE)); |
|
114 | + $result = json_decode($result->body, TRUE); |
|
115 | 115 | |
116 | 116 | if(array_key_exists('error', $result) && $result['error'] == 'post_blocked') |
117 | 117 | { |
@@ -122,25 +122,25 @@ discard block |
||
122 | 122 | |
123 | 123 | break; |
124 | 124 | case 477: |
125 | - $result = json_decode($result->body, true); |
|
126 | - error_log('Error 477 - ' . print_r($result, true)); |
|
125 | + $result = json_decode($result->body, TRUE); |
|
126 | + error_log('Error 477 - ' . print_r($result, TRUE)); |
|
127 | 127 | break; |
128 | 128 | case 429: |
129 | - error_log('Error 429 - Too Many Requests' . print_r(json_decode($result->body, true), true)); |
|
129 | + error_log('Error 429 - Too Many Requests' . print_r(json_decode($result->body, TRUE), TRUE)); |
|
130 | 130 | exit("Error 429: Too Many Requests"); |
131 | 131 | break; |
132 | 132 | case 403: |
133 | - error_log('Error 403 - Access denied:' . print_r(json_decode($result->body, true), true)); |
|
134 | - $result = json_decode($result->body, true); |
|
133 | + error_log('Error 403 - Access denied:' . print_r(json_decode($result->body, TRUE), TRUE)); |
|
134 | + $result = json_decode($result->body, TRUE); |
|
135 | 135 | break; |
136 | 136 | case 502: |
137 | - error_log('Error 502 - ' . print_r($result, true)); |
|
138 | - $result = json_decode($result->body, true); |
|
137 | + error_log('Error 502 - ' . print_r($result, TRUE)); |
|
138 | + $result = json_decode($result->body, TRUE); |
|
139 | 139 | header('location:'.$_SERVER['PHP_SELF']); |
140 | 140 | break; |
141 | 141 | case 503: |
142 | - error_log('Error 503 - ' . print_r($result, true)); |
|
143 | - $result = json_decode($result->body, true); |
|
142 | + error_log('Error 503 - ' . print_r($result, TRUE)); |
|
143 | + $result = json_decode($result->body, TRUE); |
|
144 | 144 | |
145 | 145 | if(array_key_exists('error', $result) && $result['error'] == 'Service Unavailable') |
146 | 146 | { |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | break; |
150 | 150 | default: |
151 | 151 | error_log('Error '.$result->status_code.' - unknown error'); |
152 | - $result = json_decode($result->body, true); |
|
152 | + $result = json_decode($result->body, TRUE); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | //important for account refresh |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | */ |
174 | 174 | private function getSignHeaders() |
175 | 175 | { |
176 | - if($this->getAccessToken() == null) { |
|
176 | + if($this->getAccessToken() == NULL) { |
|
177 | 177 | $payload_accessToken = ""; |
178 | 178 | } |
179 | 179 | else { |