mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Merge branch 'ent-7035-enlace-modulos-rotos-module-library' into 'develop'
Fixed module library download links See merge request artica/pandorafms!3834
This commit is contained in:
commit
6adc987f72
@ -409,7 +409,7 @@ function print_excerpt(id_div, response) {
|
||||
category_names(elem.categories) +
|
||||
"</span></p>" +
|
||||
updated +
|
||||
elem.content.rendered +
|
||||
format_download_link(elem.content.rendered) +
|
||||
'<div class="view_web"><a href="' +
|
||||
elem.link +
|
||||
'" target="_blank"><button class="sub next">' +
|
||||
@ -516,3 +516,14 @@ function show_error_msg(selector, message_error) {
|
||||
$(selector).append("<div id='empty_result'>" + message_error + "</div>");
|
||||
}
|
||||
}
|
||||
|
||||
function format_download_link(html) {
|
||||
const regex = /href="(?!\bhttps?:\/\/\b)(?!pandorafms.com)(.*)"/gm;
|
||||
var str = html;
|
||||
const subst = `href="https://pandorafms.com$1"`;
|
||||
|
||||
// The substituted value will be contained in the result variable
|
||||
const result = str.replace(regex, subst);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user