Freelinking interferes with http: links containing CamelCasedWords

florisla - February 7, 2006 - 12:31
Project:freelinking
Version:5.x-1.2
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

When I put 'regular' http a link into a node's content, and the link contains a CamelCased word, then the freelinking module tries to make a link of the CamelWord *inside* of the http:// link. This of course is not without consequenses for the original link!

Now, the easy workaround would be to make that http: link all lowercase. However, some wiki platforms are case sensitive so this is not always possible.

I've lookad at the regular expression for freelinking and it searches for CamelCases between word boundaries. The problem comes down to the fact that a slash in a URL is also considered a word boundary.

#1

earnie - May 25, 2007 - 14:40
Version:4.5.x-1.x-dev» 5.x-1.2
Priority:normal» critical

This continues to be an issue. [[wp>Interwiki|InterWiki]] or [[http://wikipedia.org/wiki/Interwiki|InterWiki]] causes the links to be freelinking/InterWiki. I will look further at this in the code.

#2

eafarris - June 29, 2007 - 01:04
Status:active» needs review

Could you try changing line 257 to this:

<?php
$camelcaseregexp
= '/( |^)([[:upper:]][[:lower:]]+){2,}\b/';
?>

And see if that takes care of it? This new RegEx requires the CamelCase to follow a space or beginning of a line. It seems to work in my testing, but I'd like some confirmation before I commit it.

#3

ecalos - August 30, 2007 - 03:21

The following also breaks:

[[Something CamelCase Here|ThePage]]

#4

earnie - August 30, 2007 - 12:16

@ecalos: Not recommended practice. It is as nightmarish as spaces in filenames and directories.

#5

eafarris - December 17, 2008 - 20:11
Status:needs review» fixed

Fixed in freelinking-6.x-1.7. Please verify and close.

#6

System Message - December 31, 2008 - 20:20
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.