@@ -264,9 +264,13 @@ public function saveLink(request $request)
264
264
'button_id ' => "42 " ,
265
265
]);
266
266
}elseif ($ linkType ->typename == "text " ){
267
+ $ sanitizedText = $ request ->text ;
268
+ $ sanitizedText = strip_tags ($ sanitizedText , '<a><p><strong><i><ul><ol><li><blockquote><h2><h3><h4> ' );
269
+ $ sanitizedText = preg_replace ("/<a([^>]*)>/i " , "<a $1 rel= \"noopener noreferrer nofollow \"> " , $ sanitizedText );
270
+ $ sanitizedText = strip_tags_except_allowed_protocols ($ sanitizedText );
267
271
$ OrigLink ->update ([
268
272
'button_id ' => "93 " ,
269
- 'title ' => $ request -> text ,
273
+ 'title ' => $ sanitizedText ,
270
274
]);
271
275
}elseif ($ linkType ->typename == "email " ){
272
276
$ LinkURL = "mailto: " .$ LinkURL ;
@@ -387,8 +391,12 @@ public function saveLink(request $request)
387
391
}elseif ($ linkType ->typename == "heading " ){
388
392
$ links ->button_id = "42 " ;
389
393
}elseif ($ linkType ->typename == "text " ){
394
+ $ sanitizedText = $ request ->text ;
395
+ $ sanitizedText = strip_tags ($ sanitizedText , '<a><p><strong><i><ul><ol><li><blockquote><h2><h3><h4> ' );
396
+ $ sanitizedText = preg_replace ("/<a([^>]*)>/i " , "<a $1 rel= \"noopener noreferrer nofollow \"> " , $ sanitizedText );
397
+ $ sanitizedText = strip_tags_except_allowed_protocols ($ sanitizedText );
390
398
$ links ->button_id = "93 " ;
391
- $ links ->title = $ request -> text ;
399
+ $ links ->title = $ sanitizedText ;
392
400
}elseif ($ linkType ->typename == "email " ){
393
401
$ links ->link = "mailto: " .$ links ->link ;
394
402
$ links ->button_id = $ button ?->id;
@@ -789,6 +797,7 @@ public function editPage(Request $request)
789
797
$ pageName = $ request ->littlelink_name ;
790
798
$ pageDescription = strip_tags ($ request ->pageDescription , '<a><p><strong><i><ul><ol><li><blockquote><h2><h3><h4> ' );
791
799
$ pageDescription = preg_replace ("/<a([^>]*)>/i " , "<a $1 rel= \"noopener noreferrer nofollow \"> " , $ pageDescription );
800
+ $ pageDescription = strip_tags_except_allowed_protocols ($ pageDescription );
792
801
$ name = $ request ->name ;
793
802
$ checkmark = $ request ->checkmark ;
794
803
$ sharebtn = $ request ->sharebtn ;
0 commit comments