[pLog-svn] r4118 - plog/branches/lifetype-1.1.1/class/dao/userdata

Oscar Renalias oscar at renalias.net
Tue Oct 10 22:16:33 GMT 2006


Basically what I came accross is that as far as MySQL is concerned, a  
user called "Maó" is the same as a user called "mao". I'm guessing  
that it has something do with character sets but I couldn't say why  
or how. I tested this in our development server, which is running  
MySQL using the latin1 encoding:

select * from lt_users where user='Maó'
select * from lt_users where user='mao'

Both queries returned the same row... Does anybody have any idea why?

On 11 Oct 2006, at 00:57, oscar at devel.lifetype.net wrote:

> Author: oscar
> Date: 2006-10-10 21:57:54 +0000 (Tue, 10 Oct 2006)
> New Revision: 4118
>
> Modified:
>    plog/branches/lifetype-1.1.1/class/dao/userdata/ 
> lifetypeuserdataprovider.class.php
> Log:
> fixed issue 1080 (http://bugs.lifetype.net/view.php?id=1080) where  
> usernames with accented letters were causing some trouble.
>
>
> Modified: plog/branches/lifetype-1.1.1/class/dao/userdata/ 
> lifetypeuserdataprovider.class.php
> ===================================================================
> --- plog/branches/lifetype-1.1.1/class/dao/userdata/ 
> lifetypeuserdataprovider.class.php	2006-10-10 21:18:09 UTC (rev 4117)
> +++ plog/branches/lifetype-1.1.1/class/dao/userdata/ 
> lifetypeuserdataprovider.class.php	2006-10-10 21:57:54 UTC (rev 4118)
> @@ -34,7 +34,7 @@
>           */
>          function authenticateUser( $user, $pass )
>          {
> -        	$user = $this->getUserInfoFromUsername( $user );			
> +        	$user = $this->getUserInfoFromUsername( $user );
>          	if( $user ) {
>  	        	return( $user->getPassword() == md5($pass));
>  	        }
> @@ -68,7 +68,15 @@
>           */
>          function getUserInfoFromUsername( $username )
>          {
> -        	return( $this->get( "user", $username,  
> CACHE_USERIDBYNAME, Array( CACHE_USERINFO => "getId" )));        	
> +        	$user = $this->get( "user", $username,  
> CACHE_USERIDBYNAME, Array( CACHE_USERINFO => "getId" ));
> +		if( $user ) {
> +			if( $user->getUsername() != $username ) {
> +				$this->log->error( "MySQL returned object (".$user->getId 
> ().",".$user->getUsername().") for username = ".$username );
> +				$user = false;
> +			}
> +		}
> +
> +		return( $user );
>          }
>
>          /**
>
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://devel.lifetype.net/mailman/listinfo/plog-svn
>



More information about the pLog-svn mailing list