]> git.mxchange.org Git - friendica.git/commitdiff
Continued:
authorRoland Haeder <roland@mxchange.org>
Sat, 25 Mar 2017 12:14:50 +0000 (13:14 +0100)
committerRoland Haeder <roland@mxchange.org>
Sat, 25 Mar 2017 12:15:42 +0000 (13:15 +0100)
- added curly braces/spaces
- changed lower-case SQL keywords to upper-case
- used dbm::is_result() instead of count() (avoids warning in case of false is
  returned)

Signed-off-by: Roland Haeder <roland@mxchange.org>
mod/manage.php

index 10fc7c7e64e859bf737b4a0dd1acd9819042358f..e85561acfb350fc3d64f462efe8d4d929ae50556 100644 (file)
@@ -22,34 +22,34 @@ function manage_post(App $a) {
                }
        }
 
-       $r = q("select * from manage where uid = %d",
+       $r = q("SELECT * FROM `manage` WHERE `uid` = %d",
                intval($uid)
        );
 
        $submanage = $r;
 
        $identity = ((x($_POST['identity'])) ? intval($_POST['identity']) : 0);
-       if(! $identity)
+       if (! $identity) {
                return;
+       }
 
        $limited_id = 0;
        $original_id = $uid;
 
-       if(count($submanage)) {
-               foreach($submanage as $m) {
-                       if($identity == $m['mid']) {
+       if (dbm::is_result($submanage)) {
+               foreach ($submanage as $m) {
+                       if ($identity == $m['mid']) {
                                $limited_id = $m['mid'];
                                break;
                        }
                }
        }
 
-       if($limited_id) {
+       if ($limited_id) {
                $r = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
                        intval($limited_id)
                );
-       }
-       else {
+       } else {
                $r = q("SELECT * FROM `user` WHERE `uid` = %d AND `email` = '%s' AND `password` = '%s' LIMIT 1",
                        intval($identity),
                        dbesc($orig_record['email']),
@@ -70,12 +70,13 @@ function manage_post(App $a) {
        unset($_SESSION['mobile-theme']);
        unset($_SESSION['page_flags']);
        unset($_SESSION['return_url']);
-       if(x($_SESSION,'submanage'))
+       if (x($_SESSION, 'submanage')) {
                unset($_SESSION['submanage']);
-       if (x($_SESSION,'sysmsg')) {
+       }
+       if (x($_SESSION, 'sysmsg')) {
                unset($_SESSION['sysmsg']);
        }
-       if (x($_SESSION,'sysmsg_info')) {
+       if (x($_SESSION, 'sysmsg_info')) {
                unset($_SESSION['sysmsg_info']);
        }