Topic-icon JFBCLike Easy-Tag Problem

Active Subscriptions:

None
13 years 5 months ago #28847 by eileenod
Replied by eileenod on topic JFBCLike Easy-Tag Problem
Thank you for your suggestion, I did clear out the Joomla cache but this had no affect on the problem. I contacted EasyBlog as well because it appeared their settings were having no affect. It appears irrespective of settings EasyBlog is using a fixed amount of the blog post into the meta section (short posts result in all text). I have noted this a problem with EasyBlog and they are looking on their end to remove / strip the tags they've added to the head.

I'll keep you updated, please let me know if this approach is correct.

Thank you for your professional support!
-Eileen
The topic has been locked.
Support Specialist
13 years 5 months ago #28921 by alzander
Replied by alzander on topic JFBCLike Easy-Tag Problem
Eileen,
We have a fix that we're testing right now. If you're interested in implementing it to see if it fixes the issues on your site, we'd love to hear your feedback. We're planning a release over the next week with quite a few fixes, and this is likely going to be one.

To make the change, please edit the /plugins/system/jfbcsystem/jfbcsystem.php file. Around line 313, you'll see the following block of code:
/*
             * Code to strip any {JFBCxyz} tags from head. Caused issues on some users sites in 4.3.1
             * Removing until more error-proof method found.
            //Get the head
            $content = JResponse::getBody();
            $regex = '|<head(.*)?</head>|sui';
            preg_match($regex, $content, $matches);

            //Remove the tag if it's in the head
            $newHead = preg_replace('|{'.$tag.'(.*?)}|ui', '', $matches[0]);

            //Replace the head
            $content = preg_replace('|<head(.*)?</head>|sui', $newHead, $content);
            JResponse::setBody($content);
            */
Replace that whole block with the following:
/*
             * Code to strip any {JFBCxyz} tags from head. Caused issues on some user's sites in 4.3.1
             * Removing until more error-proof method found.
             */
            //Get the head
            $content = JResponse::getBody();
            $regex = '|<head(.*)?</head>|sui';
            if (preg_match($regex, $content, $matches))
            {
                if (count($matches) == 2) // more than one head is a problem, don't do anything
                {
                    //Remove the tag if it's in the head
                    $newHead = preg_replace('|{' . $tag . '(.*?)}|ui', '', $matches[0], -1, $count);

                    if ($count > 0)
                    {
                        //Replace the head
                        $content = preg_replace('|<head(.*)?</head>|sui', $newHead, $content, -1, $count);
                        if ($count == 1) // Only update the body if exactly one head was found and replaced
                            JResponse::setBody($content);
                    }
                }
            }
Make sure you do not leave the */ from the bottom of original block, or you will run into issues.

Please let us know how that goes for you. Also, please make sure you test on many pages of your site, not just the one(s) that were having issues. The code can modify the whole output HTML and affect other pages in a bad way, so we just want to make sure we're not trading a fix for one issue just to break another.

Thanks,
Alex
The topic has been locked.