@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | const USERAGENT = 'Jodel/4.40.1 Dalvik/2.1.0 (Linux; U; Android 5.1.1; )'; |
9 | 9 | const CLIENT_TYPE = 'android_4.40.1'; |
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 |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | private function getSignHeaders() |
153 | 153 | { |
154 | - if($this->getAccessToken() == null) { |
|
154 | + if($this->getAccessToken() == NULL) { |
|
155 | 155 | $payload_accessToken = ""; |
156 | 156 | } |
157 | 157 | else { |
@@ -23,13 +23,13 @@ discard block |
||
23 | 23 | } |
24 | 24 | else |
25 | 25 | { |
26 | - $userIsVoter = false; |
|
26 | + $userIsVoter = FALSE; |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | if(!$userIsVoter && !$userIsAdmin) |
30 | 30 | { |
31 | 31 | error_log($_SERVER['REMOTE_ADDR'] . ' used a wrong password on vote-ajax.php'); |
32 | - $response = array("message" => $_SERVER['REMOTE_ADDR'] . ' used a wrong password on vote-ajax.php',"success" => false); |
|
32 | + $response = array("message" => $_SERVER['REMOTE_ADDR'] . ' used a wrong password on vote-ajax.php',"success" => FALSE); |
|
33 | 33 | echo json_encode($response); |
34 | 34 | die(); |
35 | 35 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | if($remaining_votes <= 0) |
47 | 47 | { |
48 | 48 | $message = 'This voter account run out of votes. For more information please contact [email protected]'; |
49 | - $success = false; |
|
49 | + $success = FALSE; |
|
50 | 50 | |
51 | 51 | $response = array("success" => $success, "message" => $message); |
52 | 52 | echo json_encode($response); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | |
58 | 58 | $message = ""; |
59 | - $success = true; |
|
59 | + $success = TRUE; |
|
60 | 60 | $token = ""; |
61 | 61 | if(isset($_POST['vote']) && isset($_POST['postId'])) |
62 | 62 | { |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $_GET['key'] = $captcha["key"]; |
80 | 80 | $_GET['deviceUid'] = $deviceUid; |
81 | 81 | |
82 | - $success = false; |
|
82 | + $success = FALSE; |
|
83 | 83 | } |
84 | 84 | else |
85 | 85 | { |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $result = $db->query("UPDATE users |
88 | 88 | SET remaining_votes='" . $remaining_votes . "' |
89 | 89 | WHERE user_token='" . $_COOKIE['JodelVoterPassword'] . "'"); |
90 | - if($result === false) |
|
90 | + if($result === FALSE) |
|
91 | 91 | { |
92 | 92 | error_log("Update remaining votes failed: (" . $db->errno . ") " . $db->error); |
93 | 93 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | else |
99 | 99 | { |
100 | 100 | $message = 'There is no account available for this jodel. Please create at least one new account to vote this jodel.'; |
101 | - $success = false; |
|
101 | + $success = FALSE; |
|
102 | 102 | } |
103 | 103 | } |
104 | 104 |