Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

Statuses Linking to Large Pages Causes Metadata Fetch to Fail Ungracefully

12 years 3 weeks ago
  • Leaf's Avatar
    Topic Author
  • Leaf
  • Offline
  • Fresh Boarder
  • Thank you received: 0
Licenses:
JomSocial Expired

Linking to a page that has a large number of characters in its html source code causes the ajax request to fetch the metadata to fail, leaving the post status button disabled/grayed out and the user unable to post their status with that link.

An example problematic link is www.yahoo.com/food/buttermilk-fried-chicken-98838171056.html as well as many other articles on yahoo. The problem is caused by any site which exceeds the size limit set in the included library php simple html dom (included in components/com_community/libraries/vendor/simple_html_dom.php).

This problem can be addressed by overriding the value of the constant MAX_FILE_SIZE to something larger than the default of 600,000 characters. Ideally, the limit should be something harder to reach. In any case, Jomsocial should include error handling for failed parse attempts (specifically where used in the CParserMetas class (components/com_community/libraries/parsers/metas.php) in the _init method.

12 years 3 weeks ago
Licenses:

Hi, Greg.

I passed your report to our developers.
I'll update you with their response as ASAP.


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
12 years 5 days ago
Licenses:

Hi, Greg.

Please, make a safe copy of this file:

ROOT/components/com_community/libraries/parsers/metas.php

Then replace original file with patched one from package.

Please do a test and post about results on forum.


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you

This message has an attachment file.
Please log in or register to see it.

11 years 11 months ago
  • Leaf's Avatar
    Topic Author
  • Leaf
  • Offline
  • Fresh Boarder
  • Thank you received: 0
Licenses:
JomSocial Expired

The patch does not work. I see it is designed to avoid the problem of exceeding the html parser's maximum page source length by stripping out all non-images from the page before trying to parse it. There is an error in the patch's call to preg_replace.

It should allow matching across multiple lines by using the /s modifier in the search pattern. So this line:

$content = preg_replace('/<body.+<\/body>/i', '<body>' . implode(' ', $matches[0]) . '</body>', $content);

Should be modified to match
$content = preg_replace('/<body.+<\/body>/is', '<body>' . implode(' ', $matches[0]) . '</body>', $content);

Once that is done, the patch works with the original value for MAX_FILE_SIZE in simple_html_dom.php

11 years 11 months ago
Licenses:

Hi, Greg.

Thnak you for reporting this. I passed it to our developer. It seems its just an omittance.


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW