mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX #4150 banal: Fixed PreserveLinks option in Convert::html2raw
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@78555 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
87478b2c5e
commit
44639ca404
@ -267,7 +267,7 @@ class Convert extends Object {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
// Expand hyperlinks
|
// Expand hyperlinks
|
||||||
if( !$preserveLinks && !isset($config['PreserveLink'])) {
|
if(!$preserveLinks && !$config['PreserveLinks']) {
|
||||||
$data = preg_replace('/<a[^>]*href\s*=\s*"([^"]*)">(.*?)<\/a>/ie', "Convert::html2raw('\\2').'[\\1]'", $data);
|
$data = preg_replace('/<a[^>]*href\s*=\s*"([^"]*)">(.*?)<\/a>/ie', "Convert::html2raw('\\2').'[\\1]'", $data);
|
||||||
$data = preg_replace('/<a[^>]*href\s*=\s*([^ ]*)>(.*?)<\/a>/ie', "Convert::html2raw('\\2').'[\\1]'", $data);
|
$data = preg_replace('/<a[^>]*href\s*=\s*([^ ]*)>(.*?)<\/a>/ie', "Convert::html2raw('\\2').'[\\1]'", $data);
|
||||||
|
|
||||||
@ -306,7 +306,7 @@ class Convert extends Object {
|
|||||||
|
|
||||||
// strip_tags seemed to be restricting the length of the output
|
// strip_tags seemed to be restricting the length of the output
|
||||||
// arbitrarily. This essentially does the same thing.
|
// arbitrarily. This essentially does the same thing.
|
||||||
if( !$preserveLinks ) {
|
if(!$preserveLinks && !$config['PreserveLinks']) {
|
||||||
$data = preg_replace('/<\/?[^>]*>/','', $data);
|
$data = preg_replace('/<\/?[^>]*>/','', $data);
|
||||||
} else {
|
} else {
|
||||||
$data = strip_tags($data, '<a>');
|
$data = strip_tags($data, '<a>');
|
||||||
|
Loading…
Reference in New Issue
Block a user