oddly

Anonymous
I posted an article on a geeklog site and for some reason, almost the entire article appears as part of the "What's Related" block, so basically you see the real article in the middle and most of the article again in the what's related block. Any ideas on how to fix this behavior so it only shows the story's links?

The site affected

the article posted (first 2 paragraphs in intro, the rest in the body)


oddly

Anonymous
Also, that site is running geeklog 1.3.9

Status: offline

Turias

Forum User
Full Member
Registered: 10/20/03
Posts: 807
Hmm, maybe it's a bug with 'a name'. Could you try removing that and seeing if it fixes it?

Status: offline

asmaloney

Forum User
Full Member
Registered: 02/08/04
Posts: 214
Quote by oddly:Any ideas on how to fix this behavior so it only shows the story's links?


In lib-common.php in the function COM_extractLinks, try changing this:
Text Formatted Code
preg_match_all( "/(<a.*?href="(.*?)".*?>)(.*?)(</a>)/i", $fulltext, $matches );

 


to this:
Text Formatted Code
preg_match_all( "/(<a +?href="(.*?)".*?>)(.*?)(</a>)/i", $fulltext, $matches );

 


This will restrict it to matching only spaces between the 'a' and the 'href' which seems to be the problem.

oddly

Anonymous
Quote by Turias: Hmm, maybe it's a bug with 'a name'. Could you try removing that and seeing if it fixes it?


Yup. Removing the "a name" html tags fixed it immediately.

Status: offline

Turias

Forum User
Full Member
Registered: 10/20/03
Posts: 807
Yeah, asmaloney's hack will work, but it won't pick up links with attributes between the 'a' and the 'href' (like 'title', 'style', or 'class').

Looks like a bug with 'a' tags that don't hold a 'href' attribute. Wanna file a bug report?

oddly

Anonymous
Thanks for the patch!! It fixed the problem completely.

oddly

Anonymous
http://project.geeklog.net/ responds with "The Geeklog Project Site Could Not Connect to Database:" when I try to go there to report this bug.

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Quote by oddly: http://project.geeklog.net/ responds with "The Geeklog Project Site Could Not Connect to Database:" when I try to go there to report this bug.

Keep trying ... The project site is a bit unstable these days. That should be resolved soon, hopefully, when we finally move it to the new server.

bye, Dirk