Closed (fixed)
Project:
External Link Page
Version:
7.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
20 Jul 2011 at 14:39 UTC
Updated:
21 Apr 2012 at 15:01 UTC
Hi! There is a serious bug in this module: if the module enabled, all internal links does not work and look as some text. This bug is caused by function _ext_link_page_replace() in file ext_link_page.module.
So, i have corrected this bug, and you can see the full code of this function below.
function _ext_link_page_replace($match) {
// Get defaults
$defaults = _ext_link_page_get_defaults();
$url = $match[1];
$filtered = '';
// If the link is external and valid and it's not an absolute link to the current site
if (url_is_external($match[1])) {
$filtered = url(
variable_get('ext_link_page_link_page', $defaults['ext_link_page_link_page']),
array(
'query' => array(
'url' => $match[1],
),
)
);
$filtered = 'href="' . $filtered . '"';
// Check if we want new window or nofollow
if (variable_get('ext_link_page_new_window', $defaults['ext_link_page_new_window'])) {
$filtered .= ' target="_blank"';
}
if (variable_get('ext_link_page_nofollow', $defaults['ext_link_page_nofollow'])) {
$filtered .= ' rel="nofollow"';
}
return $filtered;
}
else {
$filtered = 'href="' . $match[1] . '"';
return $filtered;
}
}
Comments
Comment #1
rewiaca commentedThanks dude, works like a charm!
Comment #2
deastlack commentedI have been banging my head against a wall for three days over an issue similar to this. When the External Link Page module is used in conjunction with the CK Editor Link module, all internal links are reduced to the domain only, rendering them useless. The solution to the CK Editor issue was to deactivate the ELP module. Simply reordering the filters did not suffice.
I don't know if the above code has been included in the recommended release yet, but if not can you please let me know:
I will in the meantime examine the code installed on my site to ascertain its status and will keep in touch.
Thanks for your time and attention.
Comment #3
arithmetric commentedThis is fixed in 7.x-1.0-rc1.