Quick fix for DirectionDetector: only apply <span class="rtl"> once; if it's already there in an incoming message (eg via OStatus), don't reapply it.

Modified from patch from Everplays
This commit is contained in:
Brion Vibber 2010-05-05 11:28:05 -07:00
parent 60825ba535
commit 8260a88f41

View File

@ -38,7 +38,7 @@ class DirectionDetectorPlugin extends Plugin {
* @param object $notice notice is going to be saved * @param object $notice notice is going to be saved
*/ */
public function onStartNoticeSave(&$notice){ public function onStartNoticeSave(&$notice){
if(self::isRTL($notice->content)) if(!preg_match('/<span class="rtl">/', $notice->rendered) && self::isRTL($notice->content))
$notice->rendered = '<span class="rtl">'.$notice->rendered.'</span>'; $notice->rendered = '<span class="rtl">'.$notice->rendered.'</span>';
return true; return true;
} }