diff options
| author | Nick Palmer <nick@sluggardy.net> | 2009-12-22 14:12:41 +0000 |
|---|---|---|
| committer | Nick Palmer <nick@sluggardy.net> | 2009-12-22 14:12:41 +0000 |
| commit | 9aa229641a99ff829ca44692eb07b4529e876761 (patch) | |
| tree | 7ede8667442a42f2fd6c2a3bec5f0c7e3e9a77c7 | |
| parent | 6b5ccb923902b072814f6f304506b19316321daf (diff) | |
| download | boards-9aa229641a99ff829ca44692eb07b4529e876761.tar.gz boards-9aa229641a99ff829ca44692eb07b4529e876761.tar.bz2 boards-9aa229641a99ff829ca44692eb07b4529e876761.zip | |
Lookup board email address using LOWER since we lowercase the address from the email.
| -rw-r--r-- | admin/boardsync_inc.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/admin/boardsync_inc.php b/admin/boardsync_inc.php index 3dcc3d8..690fac4 100644 --- a/admin/boardsync_inc.php +++ b/admin/boardsync_inc.php @@ -188,17 +188,19 @@ function board_sync_get_user( $pFrom ) { return $gBitUser->getUserInfo( array( 'user_id'=>-1 ) ); } -function cache_check_content_prefs( $pName, $pValue ) { +function cache_check_content_prefs( $pName, $pValue, $pLower = FALSE ) { global $gBitDb, $gBitSystem; static $prefs; - if( empty($prefs[$pName]) ) { + if( empty($prefs[$pLower][$pName]) ) { $bindVars = array( $pName ); - $prefs[$pName] = $gBitDb->getAssoc( "SELECT `pref_value`, `content_id` FROM `".BIT_DB_PREFIX."liberty_content_prefs` WHERE `pref_name`=?", $bindVars ); + $prefs[$pLower][$pName] = $gBitDb->getAssoc( "SELECT " . + ($pLower ? 'LOWER(`pref_value`)' : '`pref_value`'). + ", `content_id` FROM `".BIT_DB_PREFIX."liberty_content_prefs` WHERE `pref_name`=?", $bindVars ); } - if( !empty($prefs[$pName][$pValue]) ) { - return $prefs[$pName][$pValue]; + if( !empty($prefs[$pLower][$pName][$pValue]) ) { + return $prefs[$pLower][$pName][$pValue]; } return NULL; @@ -272,7 +274,7 @@ function board_sync_process_message( $pMbox, $pMsgNum, $pMsgHeader, $pMsgStructu foreach( $toAddresses AS $to ) { if ($pLog) print( " Processing email: " . strtolower($to['email']) . "\n"); // get a board match for the email address - if( $boardContentId = cache_check_content_prefs( 'board_sync_list_address', strtolower($to['email']) ) ) { + if( $boardContentId = cache_check_content_prefs( 'board_sync_list_address', strtolower($to['email']), TRUE ) ) { if ($pLog) print "Found Board Content $boardContentId for $to[email]\n"; if( !empty( $in_reply_to ) ) { if( $parent = $gBitDb->GetRow( "SELECT `content_id`, `root_id` FROM `".BIT_DB_PREFIX."liberty_comments` WHERE `message_guid`=?", array( $in_reply_to ) ) ) { |
