Bug #393
Warning in logs if no forbidden caracters defined
| Status: | New | Start: | 30/01/2012 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assigned to: | - | % Done: | 0% |
|
| Category: | Self Service Password | |||
| Target version: | self-service-password-? |
Description
Not having any forbidden characters, i.e. $pwd_forbidden_chars = ""; in conf.config.in.php triggers the following warning :
[Mon Jan 30 17:40:40 2012] [error] [client 172.23.1.214] PHP Warning: preg_match_all(): Compilation failed: missing terminating ] for character class at offset 2 in /application/pwdreset/test/lib/functions.inc.php on line 153
The corresponding code :
preg_match_all("/[$pwd_forbidden_chars]/", $password, $forbidden_res);
$forbidden = count( $forbidden_res[0] );
should include a test for both existence and non emptyness of $pwd_forbidden_chars and should be replaced by something like this :
$forbidden = 0;
if ( isset($pwd_forbidden_chars) && !empty($pwd_forbidden_chars) ) {
preg_match_all("/[$pwd_forbidden_chars]/", $password, $forbidden_res);
$forbidden = count( $forbidden_res[0] );
}
Please note that the same applies to special characters ($pwd_special_chars) which will trigger the same warning if undefined or empty.
History
Updated by Clément OUDOT 4 months ago
- Category set to Self Service Password
- Target version set to self-service-password-?
Hi,
please pick a subject that describe the problem.
For the content you are right, this will be put in the next release.
Updated by Clément OUDOT about 1 month ago
- Subject changed from self-service-password 0.7 (latest version) to Warning in logs if no forbidden caracters defined