Koha/koha-tmpl/intranet-tmpl/prog/en/includes/wysiwyg-systempreferences.inc
Didier Gautheron 2fbe775070 Bug 25862: Prevent TinyMCE to mangle local url links
To test:
1 create a report 1 if it doesn't exist
2 open /cgi-bin/koha/tools/koha-news.pl
3 create a news
4 add a HTML link with Insert/Edit link tinyMCE dialog box to
  /cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Run%20this%20report "report 1"
5 save
6 on the main page "report 1" link returns a 404 error

Apply patch
7 Modify news' URL
8 Test it works in: tools/koha-new.pl admin/branches.pl and admin/preferences.pl

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-07-20 14:05:21 +02:00

36 lines
1.5 KiB
PHP

[% USE raw %]
[% USE Asset %]
[% #Enable tinymce for system preferences %]
[% Asset.js("lib/tiny_mce/tinymce.min.js") | $raw %]
[% INCLUDE 'str/tinymce_i18n.inc' %]
<!-- wysiwyg-systempreferences.inc -->
<script>
// Save TinyMCE content and trigger an event on the original element
function wysiwyg_change (ed){
ed.save();
var original_textarea = ed.getElement();
$(original_textarea).trigger("input");
}
tinyMCE.init({
branding : false,
relative_urls : false,
content_css : "[% interface | html %]/[% theme | html %]/css/tinymce.css",
editor_selector : "mce",
menubar : "file edit view insert format tools table",
mode : "specific_textareas",
plugins : "autoresize table hr link image charmap lists code emoticons",
toolbar : [
"formatselect | bold italic | cut copy paste | alignleft aligncenter alignright | outdent indent | image link unlink anchor cleanup hr",
"table | bullist numlist | undo redo | removeformat | emoticons charmap | forecolor backcolor | code visualaid help"
],
init_instance_callback: function (editor) {
editor.on('Dirty', function (e) {
// When a change has been made to the contents of an editor,
// enable the corresponding preference Save button
wysiwyg_change( editor );
});
}
});
</script>
<!-- / wysiwyg-systempreferences.inc -->