If I insert

Fonte: EnergyManager.net

into a blog entry, EnergyManager is transformed into a link

http://.../.../?q=freelinking/EnergyManager

in spite ho having CameCase disabled in the settings.

Comments

Grayside’s picture

Please double-check the settings and clear the cache.

mpcabd’s picture

I've also faced the same problem, `freelinking_camelcase` is disabled and I cleared the cache but nothing happened, still every CamelCase word is converted into a link, I fixed that by editing `_freelinking_do_filtering` function in the module:
These lines were executed anyways, even if the previous if .. else if .. wasn't executed:

$text = preg_replace($pattern, $replacement, $text, variable_get("freelinking_onceonly", 0) ? 1 : -1);
if ($store) {
    _freelinking_store($freelink, $replacement);
}

I moved those lines into the bodies of the if and else if so it can only be executed when the previous if .. else .. is executed and the problem was solved.

  foreach (array_unique($wikiwords) as $wikiword) {
    if (substr($wikiword, 0, 2) == '[[') { // if it's a freelink, the expressions are different
      $phrase = substr($wikiword, 2, -2);
      $freelink = $phrase;
      $barpos = strpos($phrase, '|');
      $pattern = '/\[\[' . preg_quote($phrase,'/') . ']]/';
      if ($barpos) {
         $freelink = substr($freelink, 0, $barpos);
         $phrase = substr($phrase, $barpos + 1);
      }
      if (preg_match('/^(http|mailto|ftp):/', $freelink)) {
         $replacement = '<a class="freelinking external" href="' . $freelink . '">' . $phrase . '</a>';
         $store = FALSE;
      }
      else {
        $replacement = l(html_entity_decode($phrase), 'freelinking/' . $freelink, array('attributes' => array('class' => 'freelinking s')));
      }
			$text = preg_replace($pattern, $replacement, $text, variable_get("freelinking_onceonly", 0) ? 1 : -1);
    
			if ($store) {
				_freelinking_store($freelink, $replacement);
			}
    }

    else if ($allowcamelcase) { // it's a CamelCase, expressions are a bit simpler
      $pattern = '/(?<!\/)\b' . $wikiword . '\b(?![^<]*>)/';
      $phrase = $wikiword; // consistency for the db
      $freelink = $wikiword; // also for the db
      $replacement = l($wikiword, 'freelinking/' . urlencode($wikiword), array('attributes' => array('class' => 'freelinking w')));
			$text = preg_replace($pattern, $replacement, $text, variable_get("freelinking_onceonly", 0) ? 1 : -1);
    
			if ($store) {
				_freelinking_store($freelink, $replacement);
			}
    }
    
  }
juampynr’s picture

Status: Active » Closed (cannot reproduce)

I could not reproduce this issue. Here is what I did:

  1. Installed freelinking 6.x.1.x.
  2. Checked that "Allow CamelCase linking" was disabled at admin/settings/freelinking
  3. Enabled freelinking filter
  4. Created a page with "Fonte: EnergyManager.net" in the body > there was no freelink created.