OSDN Git Service

FIX:NP_SecurityEnforcerのpreg_matchのデリミタを変更して「#」のエスケープを削除
[nucleus-jp/nucleus-next.git] / nucleus / plugins / NP_SecurityEnforcer.php
index ee4c194..915d1d5 100644 (file)
@@ -18,19 +18,7 @@ PARTICULAR PURPOSE. See the GNU General Public License for more details.
 */
 class NP_SecurityEnforcer extends NucleusPlugin
 {
-   function event_PrePluginOptionsEdit($data)
-   {
-      if ($data['plugid'] === $this->getID()) {
-         foreach($data['options'] as $key => $value){
-            if (defined($value['description'])) {
-               $data['options'][$key]['description'] = constant($value['description']);
-            }
-//            if (!strcmp($value['type'], 'select') && defined($value['typeinfo'])) {
-//               $data['options'][$key]['typeinfo'] = constant($value['typeinfo']);
-//            }
-         }
-      }
-   }
+
        public function getName()
        {
                return 'SecurityEnforcer';
@@ -68,7 +56,7 @@ class NP_SecurityEnforcer extends NucleusPlugin
 
        public function getEventList()
        {
-               return array('PrePluginOptionsEdit', 'QuickMenu','PrePasswordSet','CustomLogin','LoginSuccess','LoginFailed','PostRegister');
+               return array('QuickMenu','PrePasswordSet','CustomLogin','LoginSuccess','LoginFailed','PostRegister');
        }
 
        public function hasAdminArea() {
@@ -289,6 +277,7 @@ class NP_SecurityEnforcer extends NucleusPlugin
        {
                $minlength = intval($minlength);
                $complexity = intval($complexity);
+               $message = '';
                
                if ( $minlength < 6 )
                {
@@ -307,14 +296,14 @@ class NP_SecurityEnforcer extends NucleusPlugin
                $ucchars        = '[A-Z]';
                $lcchars        = '[a-z]';
                $numchars       = '[0-9]';
-               $ochars         = '[-~!@#\$%^&*()_+=,.<>?:;|]';
+               $ochars         = '[#-~!@\\$%^&*()_+=,.<>?:;|]';
                $chartypes      = array($ucchars, $lcchars, $numchars, $ochars);
                $tot            = array(0,0,0,0);
                $i                      = 0;
                
                foreach ( $chartypes as $value )
                {
-                       $tot[$i] = preg_match("#" . $value . "#", $passwd);
+                       $tot[$i] = preg_match("/" . $value . "/", $passwd);
                        $i = $i + 1;
                }