View Single Post
  #5  
Old 11-26-2008, 05:20 AM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default Re: 4.2 User Name Question

Strange...
In 4.1.8 (note: no "!preg_match" or "eregi")
Code:
# # Check for errors # $uname_tmp=stripslashes($uname); if (strcmp($uname_tmp, $uname) !=0) $error="Username ".$uname_tmp." is invalid! Please correct"; else $error=''; $smarty->assign("error",$error);
In 4.1.10 (added "eregi" and "newbie/anonymous" checks)
Code:
# # Check for errors # $uname_tmp=stripslashes($uname); if ((strcmp($uname_tmp, $uname) !=0) || (eregi("[^a-z0-9_-]",$uname) && $newbie == "Y" && $anonymous != "Y")) $error="username"; else $error=''; $smarty->assign("error",$error);
In Security Patch 2008-07-02_4.1.10 (no change from 4.1.10 - still "eregi"and "newbie/anonymous" checks)
Code:
# # Check for errors # $uname_tmp=stripslashes($uname); if ((strcmp($uname_tmp, $uname) !=0) || (eregi("[^a-z0-9_-]",$uname) && $newbie == "Y" && $anonymous != "Y")) $error="username"; else $error=''; $smarty->assign("error",$error);
In 4.1.11 (changed "eregi" to "!preg_match"and no "newbie/anonymous" checks)
Code:
# # Check for errors # $error = ''; # Login will be checked only for new profiles if ($mode != "update") { $uname_tmp = stripslashes($uname); if ((strcmp($uname_tmp, $uname) != 0) || (!preg_match("/^[a-z0-9_-]+$/s", $uname) && $uname != "")) $error = "username"; } $smarty->assign("error", $error);
In 4.2.0b (no change from 4.1.11)
Code:
# # Check for errors # $error = ''; # Login will be checked only for new profiles if ($mode != "update") { $uname_tmp = stripslashes($uname); if ((strcmp($uname_tmp, $uname) != 0) || (!preg_match("/^[a-z0-9_-]+$/s", $uname) && $uname != "")) $error = "username"; } $smarty->assign("error", $error);

This brings some questions...
1. Why the switch from "eregi" to "!preg_match"?
2 Why were the "newbie" and "anonymous" checks added, then removed?
3. Why was "if ($mode != "update")" added if, as you say, "There is something over riding the settings" when it is updated?
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote