[Tip] fix message-sending error to non-latin users

In Dolphin 7.1, there is an issue when you try to send a message (through web) to a user which nickname is non-latin. Specifically, I had it with Hebrew nicknames. When you try to send a message to such a user, you get an error "profile not found".

The fix for this involves a small and simple code change, but make sure you know what you're doing and backup the PHP file before you modify it.

The change is in file "admin.inc.php", which you'll find under the "/inc" folder in your root installation directory.
Inside this file, find the declaration of "function getID".
In this function, locate the line marked red:

 

if ( $with_email ) {
       if ( eregi("^[_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,4}$", $str) ) {
          $str = process_db_input($str);
          $mail_arr = db_arr( "SELECT `ID` FROM `Profiles` WHERE `Email` = '$str'" );
          if ( (int)$mail_arr['ID'] ) {
              return (int)$mail_arr['ID'];
           }
       }
   }

    $str = process_db_input($str);
     ....

and change it to:

    $str = process_db_input($str, BX_TAGS_SPECIAL_CHARS);

 

The extra param sent to the function, makes sure the string is treated as a UTF-8 string. It doesn't harm messages sent to English named users, and doesn't seem to interrupt with any other function in the site, so it seems safe to use. If you encounter any issue with it- please report.

 

This fix was tested on Dolphin 7.1.0 and 7.1.1.

 

Quote · 15 Mar 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.