/[LeafOK_CVS]/fenglin/bbs/user_reg_check.inc.php
ViewVC logotype

Annotation of /fenglin/bbs/user_reg_check.inc.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations)
Tue Apr 29 11:55:32 2025 UTC (10 months, 2 weeks ago) by sysadm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +0 -1 lines
Remove redundant PHP closing tag

1 sysadm 1.1 <?php
2 sysadm 1.2 function check_str($str) : bool
3 sysadm 1.1 {
4     $filename = "../conf/deny_reg.conf";
5     $contents = file_get_contents($filename);
6    
7     if ($contents == false)
8     {
9     echo ("Reversed words list not exist!\n");
10     return false;
11     }
12    
13     // Builds the reserved words array
14     $word_list = explode("\n", str_replace("\r\n", "\n", $contents));
15    
16     // Do the checking
17     foreach ($word_list as $reg_exp)
18     {
19     if ($reg_exp != "" && preg_match("/" . $reg_exp . "/i", $str))
20     {
21     return false;
22     }
23     }
24    
25     return true;
26     }

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1