]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Quick fix for DirectionDetector: only apply <span class="rtl"> once; if it's already...
authorBrion Vibber <brion@pobox.com>
Wed, 5 May 2010 18:28:05 +0000 (11:28 -0700)
committerBrion Vibber <brion@pobox.com>
Wed, 5 May 2010 18:28:05 +0000 (11:28 -0700)
Modified from patch from Everplays

plugins/DirectionDetector/DirectionDetectorPlugin.php

index 0277e02c56ffe895b7dfc9f8d26d53e542508441..34c511e21d49c413c8d96f09dff59ec024af3526 100644 (file)
@@ -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('/<span class="rtl">/', $notice->rendered) && self::isRTL($notice->content))
                        $notice->rendered = '<span class="rtl">'.$notice->rendered.'</span>';
                return true;
        }