viewgit/inc/functions.php:22 Function utf8_encode() is deprecated [8192]

Fix GroupModel.php notice, a=hcrris

Chris Pollett [2020-08-11 05:Aug:th]
Fix GroupModel.php notice, a=hcrris
Filename
src/models/GroupModel.php
diff --git a/src/models/GroupModel.php b/src/models/GroupModel.php
index 4a60eb213..c44ad65bc 100644
--- a/src/models/GroupModel.php
+++ b/src/models/GroupModel.php
@@ -610,7 +610,7 @@ class GroupModel extends Model implements MediaConstants
         if ($result) {
             $row = $db->fetchArray($result);
         }
-        return $row['NUM'];
+        return $row['NUM'] ?? 0;
     }
     /**
      * Get the key of the group.
@@ -1144,7 +1144,15 @@ class GroupModel extends Model implements MediaConstants
         if (empty($result)) {
             return "";
         }
-        return $db->fetchArray($result);
+        $row = $db->fetchArray($result);
+        if (!empty($group_id) &&
+            $this->isGroupEncrypted($group_id)) {
+            // Decrypt group's title and description
+            $key = $this->getGroupKey($group_id);
+            $row['TITLE'] = $this->decrypt($row['TITLE'], $key);
+            $row['DESCRIPTION'] = $this->decrypt($row['DESCRIPTION'], $key);
+        }
+        return $row;
     }
     /**
      * Returns the number of distinct threads in a group's feed
ViewGit