From: Marek R. <ap...@ph...> - 2009-08-02 16:45:30
|
Author: aptx Date: Sun Aug 2 17:44:45 2009 New Revision: 9914 Log: #48965 Modified: branches/phpBB-3_0_0/phpBB/includes/message_parser.php Modified: branches/phpBB-3_0_0/phpBB/includes/message_parser.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/message_parser.php (original) --- branches/phpBB-3_0_0/phpBB/includes/message_parser.php Sun Aug 2 17:44:45 2009 *************** *** 1317,1323 **** } // (assertion) ! $match[] = '(?<=^|[\n .])' . preg_quote($row['code'], '#') . '(?![^<>]*>)'; $replace[] = '<!-- s' . $row['code'] . ' --><img src="{SMILIES_PATH}/' . $row['smiley_url'] . '" alt="' . $row['code'] . '" title="' . $row['emotion'] . '" /><!-- s' . $row['code'] . ' -->'; } $db->sql_freeresult($result); --- 1317,1323 ---- } // (assertion) ! $match[] = preg_quote($row['code'], '#'); $replace[] = '<!-- s' . $row['code'] . ' --><img src="{SMILIES_PATH}/' . $row['smiley_url'] . '" alt="' . $row['code'] . '" title="' . $row['emotion'] . '" /><!-- s' . $row['code'] . ' -->'; } $db->sql_freeresult($result); *************** *** 1327,1333 **** { if ($max_smilies) { ! $num_matches = preg_match_all('#' . implode('|', $match) . '#', $this->message, $matches); unset($matches); if ($num_matches !== false && $num_matches > $max_smilies) --- 1327,1333 ---- { if ($max_smilies) { ! $num_matches = preg_match_all('#(?<=^|[\n .])(?:' . implode('|', $match) . ')(?![^<>]*>)#', $this->message, $matches); unset($matches); if ($num_matches !== false && $num_matches > $max_smilies) *************** *** 1338,1344 **** } // Make sure the delimiter # is added in front and at the end of every element within $match ! $this->message = trim(preg_replace(explode(chr(0), '#' . implode('#' . chr(0) . '#', $match) . '#'), $replace, $this->message)); } } --- 1338,1344 ---- } // Make sure the delimiter # is added in front and at the end of every element within $match ! $this->message = trim(preg_replace(explode(chr(0), '#(?<=^|[\n .])' . implode('(?![^<>]*>)#' . chr(0) . '#(?<=^|[\n .])', $match) . '(?![^<>]*>)#'), $replace, $this->message)); } } |