OSDN Git Service

FIX: PHP5/MySQL5における文法違反コードの修正
[nucleus-jp/nucleus-jp-ancient.git] / nucleus / libs / BAN.php
index 7449f41..7aad84c 100755 (executable)
@@ -47,27 +47,23 @@ class BAN {
 
                $blogid = intval($blogid);
 
-               $manager->notify(
-                       'PreAddBan',
-                       array(
-                               'blogid' => $blogid,
-                               'iprange' => &$iprange,
-                               'reason' => &$reason
-                       )
+               $param = array(
+                       'blogid'        =>  $blogid,
+                       'iprange'       => &$iprange,
+                       'reason'        => &$reason
                );
+               $manager->notify('PreAddBan', $param);
 
                $query = 'INSERT INTO '.sql_table('ban')." (blogid, iprange, reason) VALUES "
                           . "($blogid,'".sql_real_escape_string($iprange)."','".sql_real_escape_string($reason)."')";
                $res = sql_query($query);
 
-               $manager->notify(
-                       'PostAddBan',
-                       array(
-                               'blogid' => $blogid,
-                               'iprange' => $iprange,
-                               'reason' => $reason
-                       )
+               $param = array(
+                       'blogid'        => $blogid,
+                       'iprange'       => $iprange,
+                       'reason'        => $reason
                );
+               $manager->notify('PostAddBan', $param);
 
                return $res ? 1 : 0;
        }
@@ -80,14 +76,22 @@ class BAN {
                global $manager;
                $blogid = intval($blogid);
 
-               $manager->notify('PreDeleteBan', array('blogid' => $blogid, 'range' => $iprange));
+               $param = array(
+                       'blogid'        => $blogid,
+                       'range'         => $iprange
+               );
+               $manager->notify('PreDeleteBan', $param);
 
                $query = 'DELETE FROM '.sql_table('ban')." WHERE blogid=$blogid and iprange='" .sql_real_escape_string($iprange). "'";
                sql_query($query);
 
                $result = (sql_affected_rows() > 0);
 
-               $manager->notify('PostDeleteBan', array('blogid' => $blogid, 'range' => $iprange));
+               $param = array(
+                       'blogid'        => $blogid,
+                       'range'         => $iprange
+               );
+               $manager->notify('PostDeleteBan', $param);
 
                return $result;
        }