Completed
Push — master ( 769cd4...335df2 )
by mains
02:46
created
php/JodelAccount.php 1 patch
Upper-Lower-Casing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -93,16 +93,16 @@  discard block
 block discarded – undo
93 93
     {
94 94
         $url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . htmlspecialchars($city) . '&key=AIzaSyCwhnja-or07012HqrhPW7prHEDuSvFT4w';
95 95
         $result = Requests::post($url);
96
-        if(json_decode($result->body, true)['status'] == 'ZERO_RESULTS' || json_decode($result->body, true)['status'] == 'INVALID_REQUEST')
96
+        if(json_decode($result->body, TRUE)['status'] == 'ZERO_RESULTS' || json_decode($result->body, TRUE)['status'] == 'INVALID_REQUEST')
97 97
         {
98 98
             error_log('Error locationEquals');
99 99
             return FALSE;
100 100
         }
101 101
         else
102 102
         {
103
-            $name = json_decode($result->body, true)['results']['0']['address_components']['0']['long_name'];
104
-            $lat = json_decode($result->body, true)['results']['0']['geometry']['location']['lat'];
105
-            $lng = json_decode($result->body, true)['results']['0']['geometry']['location']['lng'];
103
+            $name = json_decode($result->body, TRUE)['results']['0']['address_components']['0']['long_name'];
104
+            $lat = json_decode($result->body, TRUE)['results']['0']['geometry']['location']['lat'];
105
+            $lng = json_decode($result->body, TRUE)['results']['0']['geometry']['location']['lng'];
106 106
         }
107 107
 
108 108
         $db = new DatabaseConnect();
@@ -146,15 +146,15 @@  discard block
 block discarded – undo
146 146
         {
147 147
             $url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . htmlspecialchars($_GET['city']) . '&key=AIzaSyCwhnja-or07012HqrhPW7prHEDuSvFT4w';
148 148
             $result = Requests::post($url);
149
-            if(json_decode($result->body, true)['status'] == 'ZERO_RESULTS' || json_decode($result->body, true)['status'] == 'INVALID_REQUEST')
149
+            if(json_decode($result->body, TRUE)['status'] == 'ZERO_RESULTS' || json_decode($result->body, TRUE)['status'] == 'INVALID_REQUEST')
150 150
             {
151 151
                 return "0 results";
152 152
             }
153 153
             else
154 154
             {
155
-                $name = json_decode($result->body, true)['results']['0']['address_components']['0']['long_name'];
156
-                $lat = json_decode($result->body, true)['results']['0']['geometry']['location']['lat'];
157
-                $lng = json_decode($result->body, true)['results']['0']['geometry']['location']['lng'];
155
+                $name = json_decode($result->body, TRUE)['results']['0']['address_components']['0']['long_name'];
156
+                $lat = json_decode($result->body, TRUE)['results']['0']['geometry']['location']['lat'];
157
+                $lng = json_decode($result->body, TRUE)['results']['0']['geometry']['location']['lng'];
158 158
 
159 159
                 $location = new Location();
160 160
                 $location->setLat($lat);
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
                                 lng='" . $lng . "'
177 177
                             WHERE access_token='" . $this->accessToken . "'");
178 178
 
179
-                    if($result === false)
179
+                    if($result === FALSE)
180 180
                     {
181 181
                             echo "Updating location failed: (" . $db->errno . ") " . $db->error;
182 182
                     }
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
                 $accountCreator->postId = htmlspecialchars($postId);
278 278
                 $data = $accountCreator->execute();
279 279
 
280
-                user_log('User voted: ' . print_r($data, true));
280
+                user_log('User voted: ' . print_r($data, TRUE));
281 281
 
282 282
                 if(array_key_exists('post', $data))
283 283
                 {
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
                 }
291 291
                 else
292 292
                 {
293
-                    error_log('Could not vote: ' . print_r($data, true));
293
+                    error_log('Could not vote: ' . print_r($data, TRUE));
294 294
                     return FALSE;
295 295
                 } 
296 296
             }
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
         
356 356
 		if($data != 'Success')
357 357
 		{
358
-			error_log('Could not set location befor Post: ' . print_r($data, true));
358
+			error_log('Could not set location befor Post: ' . print_r($data, TRUE));
359 359
 		}
360 360
 
361 361
         $accountCreator->location = $this->location;
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
             return $errorMsg;
378 378
         }
379 379
 
380
-        user_log('User posted: ' . print_r($data, true));
380
+        user_log('User posted: ' . print_r($data, TRUE));
381 381
 
382 382
         if(isset($_POST['ancestor']))
383 383
         {
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
                                     expiration_date='" . $expiration_date . "'
436 436
                                 WHERE device_uid='" . $device_uid . "'");
437 437
 
438
-        if($result === false){
438
+        if($result === FALSE){
439 439
                 error_log("Adding account failed: (" . $db->errno . ") " . $db->error);
440 440
         }   
441 441
     }
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
 
484 484
         $result = $db->query("SELECT id FROM votes WHERE (postId = '" . $postId . "' AND device_uid = '" . $this->deviceUid . "')");
485 485
         
486
-        if($result === false)
486
+        if($result === FALSE)
487 487
         {
488 488
             $error = db_error();
489 489
             echo $error;
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
         $result = $db->query("INSERT INTO votes (device_uid, postId, type)
516 516
                         VALUES ('" . $this->deviceUid . "','" . $postId . "','" . $voteType . "')");
517 517
         
518
-        if($result === false){
518
+        if($result === FALSE){
519 519
                 $error = db_error();
520 520
                 echo $error;
521 521
                 echo "Adding Vote failed: (" . $result->errno . ") " . $result->error;
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
                         "','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') ");
548 548
 
549 549
         $success = TRUE;
550
-        if($result === false){
550
+        if($result === FALSE){
551 551
                 $error = $db->error();
552 552
                 echo $error;
553 553
                 echo "Adding account failed: (" . $result->errno . ") " . $result->error;
Please login to merge, or discard this patch.