Selaa lähdekoodia

Delete continue

Visman 4 vuotta sitten
vanhempi
commit
cd8090310b
3 muutettua tiedostoa jossa 7 lisäystä ja 12 poistoa
  1. 2 4
      app/Core/Func.php
  2. 2 4
      app/Models/BBCodeList/Structure.php
  3. 3 4
      app/Models/Pages/Admin/Groups.php

+ 2 - 4
app/Core/Func.php

@@ -217,11 +217,9 @@ class Func
             }
 
             $l = \trim($dsr[0]);
-            if (! \preg_match('%^[[:alpha:]]{1,8}(?:-[[:alnum:]]{1,8})?$%', $l)) {
-                continue;
+            if (\preg_match('%^[[:alpha:]]{1,8}(?:-[[:alnum:]]{1,8})?$%', $l)) {
+                $result[$l] = $q;
             }
-
-            $result[$l] = $q;
         }
         \arsort($result, \SORT_NUMERIC);
 

+ 2 - 4
app/Models/BBCodeList/Structure.php

@@ -350,11 +350,9 @@ class Structure extends ParentModel
         foreach ($attrs as $name => $attr) {
             $value = $this->getBBAttr($name, ['required', 'format', 'body format', 'text only']);
 
-            if (null === $value) {
-                continue;
+            if (null !== $value) {
+                $result[$name] = $value;
             }
-
-            $result[$name] = $value;
         }
 
         return $result;

+ 3 - 4
app/Models/Pages/Admin/Groups.php

@@ -421,12 +421,11 @@ class Groups extends Admin
 
             foreach ($this->groupsNew as $key => $title) {
                 if (
-                    $key === $group->g_id
-                    || $key === $this->c->GROUP_GUEST
+                    $key !== $group->g_id
+                    && $key !== $this->c->GROUP_GUEST
                 ) {
-                    continue;
+                    $options[$key] = $title;
                 }
-                $options[$key] = $title;
             }
 
             $fieldset['g_promote_next_group'] = [