php warnings from emoji functions
Jamroom Developers
Next version of that function will read:
function jrCore_replace_emoji($string)
{
if (is_string($string)) {
if (preg_match_all('/!!emoji!!([0-9]*)!!emoji!!/i', $string, $_match)) {
$_id = array();
foreach ($_match[0] as $e) {
$_id[] = (int) str_ireplace('!!emoji!!', '', $e);
}
if (count($_id) > 0) {
$tbl = jrCore_db_table_name('jrCore', 'emoji');
$req = "SELECT CONCAT('!!emoji!!', emoji_id, '!!emoji!!') AS emoji_id, emoji_value FROM {$tbl} WHERE emoji_id IN(" . implode(',', $_id) . ")";
$_rt = jrCore_db_query($req, 'emoji_id', false, 'emoji_value', false, null, false);
if ($_rt && is_array($_rt)) {
$string = str_ireplace(array_keys($_rt), $_rt, $string);
}
}
}
}
return $string;
}