includes/pageutils.php
changeset 217 5bcdee999015
parent 209 661beb9b0fa3
child 228 7846d45bd250
equal deleted inserted replaced
216:06db76725891 217:5bcdee999015
    21    */
    21    */
    22   
    22   
    23   function checkusername($name)
    23   function checkusername($name)
    24   {
    24   {
    25     global $db, $session, $paths, $template, $plugins; // Common objects
    25     global $db, $session, $paths, $template, $plugins; // Common objects
       
    26     $name = str_replace('_', ' ', $name);
    26     $q = $db->sql_query('SELECT username FROM ' . table_prefix.'users WHERE username=\'' . $db->escape(rawurldecode($name)) . '\'');
    27     $q = $db->sql_query('SELECT username FROM ' . table_prefix.'users WHERE username=\'' . $db->escape(rawurldecode($name)) . '\'');
    27     if ( !$q )
    28     if ( !$q )
    28     {
    29     {
    29       die(mysql_error());
    30       die(mysql_error());
    30     }
    31     }