From: Brion Vibber Date: Wed, 5 May 2010 18:28:05 +0000 (-0700) Subject: Quick fix for DirectionDetector: only apply once; if it's already... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8260a88f41bb21fe5e5bd25dea15283a08c2224c;p=quix0rs-gnu-social.git Quick fix for DirectionDetector: only apply once; if it's already there in an incoming message (eg via OStatus), don't reapply it. Modified from patch from Everplays --- diff --git a/plugins/DirectionDetector/DirectionDetectorPlugin.php b/plugins/DirectionDetector/DirectionDetectorPlugin.php index 0277e02c56..34c511e21d 100644 --- a/plugins/DirectionDetector/DirectionDetectorPlugin.php +++ b/plugins/DirectionDetector/DirectionDetectorPlugin.php @@ -38,7 +38,7 @@ class DirectionDetectorPlugin extends Plugin { * @param object $notice notice is going to be saved */ public function onStartNoticeSave(&$notice){ - if(self::isRTL($notice->content)) + if(!preg_match('//', $notice->rendered) && self::isRTL($notice->content)) $notice->rendered = ''.$notice->rendered.''; return true; }