includes/pageutils.php
changeset 271 f088805540ae
parent 266 917dcc6c4ceb
parent 270 5bcdee999015
child 304 e2cb5f1432c8
equal deleted inserted replaced
266:917dcc6c4ceb 271:f088805540ae
    22    */
    22    */
    23   
    23   
    24   function checkusername($name)
    24   function checkusername($name)
    25   {
    25   {
    26     global $db, $session, $paths, $template, $plugins; // Common objects
    26     global $db, $session, $paths, $template, $plugins; // Common objects
       
    27     $name = str_replace('_', ' ', $name);
    27     $q = $db->sql_query('SELECT username FROM ' . table_prefix.'users WHERE username=\'' . $db->escape(rawurldecode($name)) . '\'');
    28     $q = $db->sql_query('SELECT username FROM ' . table_prefix.'users WHERE username=\'' . $db->escape(rawurldecode($name)) . '\'');
    28     if ( !$q )
    29     if ( !$q )
    29     {
    30     {
    30       die(mysql_error());
    31       die(mysql_error());
    31     }
    32     }