Browse Source

* Other minor fixes

Visman 6 years ago
parent
commit
cb1ef0f640

+ 6 - 6
app/Models/Censorship/Save.php

@@ -11,7 +11,7 @@ class Save extends Method
      * Сохраняет список нецензурных слов в базу
      * Сохраняет список нецензурных слов в базу
      *
      *
      * @param array $list
      * @param array $list
-     * 
+     *
      * @return Censorship
      * @return Censorship
      */
      */
     public function save(array $list)
     public function save(array $list)
@@ -22,12 +22,12 @@ class Save extends Method
             if (! isset($list[$id]['search_for']) || ! isset($list[$id]['replace_with'])) {
             if (! isset($list[$id]['search_for']) || ! isset($list[$id]['replace_with'])) {
                 continue;
                 continue;
             }
             }
-            if ('' === trim($list[$id]['search_for'])) {
+            if ('' === \trim($list[$id]['search_for'])) {
                 if ($id > 0) {
                 if ($id > 0) {
                     $forDel[] = $id;
                     $forDel[] = $id;
                 }
                 }
             } elseif (isset($words[$id])) {
             } elseif (isset($words[$id])) {
-                if ($list[$id]['search_for'] !== $words[$id]['search_for'] 
+                if ($list[$id]['search_for'] !== $words[$id]['search_for']
                     || $list[$id]['replace_with'] !== $words[$id]['replace_with']
                     || $list[$id]['replace_with'] !== $words[$id]['replace_with']
                 ) {
                 ) {
                     $vars = [
                     $vars = [
@@ -35,8 +35,8 @@ class Save extends Method
                         ':search'  => $list[$id]['search_for'],
                         ':search'  => $list[$id]['search_for'],
                         ':replace' => $list[$id]['replace_with'],
                         ':replace' => $list[$id]['replace_with'],
                     ];
                     ];
-                    $sql = 'UPDATE ::censoring 
-                            SET search_for=?s:search, replace_with=?s:replace 
+                    $sql = 'UPDATE ::censoring
+                            SET search_for=?s:search, replace_with=?s:replace
                             WHERE id=?i:id';
                             WHERE id=?i:id';
                     $this->c->DB->exec($sql, $vars);
                     $this->c->DB->exec($sql, $vars);
                 }
                 }
@@ -45,7 +45,7 @@ class Save extends Method
                     ':search'  => $list[$id]['search_for'],
                     ':search'  => $list[$id]['search_for'],
                     ':replace' => $list[$id]['replace_with'],
                     ':replace' => $list[$id]['replace_with'],
                 ];
                 ];
-                $sql = 'INSERT INTO ::censoring (search_for, replace_with) 
+                $sql = 'INSERT INTO ::censoring (search_for, replace_with)
                         VALUES (?s:search, ?s:replace)';
                         VALUES (?s:search, ?s:replace)';
                 $this->c->DB->exec($sql, $vars);
                 $this->c->DB->exec($sql, $vars);
             }
             }

+ 1 - 1
app/Models/Pages/Profile/Config.php

@@ -88,7 +88,7 @@ class Config extends Profile
      * @param Validator $v
      * @param Validator $v
      * @param int $value
      * @param int $value
      *
      *
-     * @return string
+     * @return int
      */
      */
     public function vToZero(Validator $v, $value)
     public function vToZero(Validator $v, $value)
     {
     {

+ 1 - 1
app/Models/Pages/Profile/Edit.php

@@ -101,7 +101,7 @@ class Edit extends Profile
 
 
             $valid = $v->validation($_FILES + $_POST);
             $valid = $v->validation($_FILES + $_POST);
             $data  = $v->getData();
             $data  = $v->getData();
-            unset($data['token'], $data['upload_avatar']);
+            unset($data['token'], $data['upload_avatar'], $data['delete_avatar']);
 
 
             if ($valid) {
             if ($valid) {
                 if ($v->delete_avatar || $v->upload_avatar instanceof Image) {
                 if ($v->delete_avatar || $v->upload_avatar instanceof Image) {