Title: malformed regex in simple-banner.php breaks relative links by adding https://
Last modified: November 30, 2023

---

# malformed regex in simple-banner.php breaks relative links by adding https://

 *  Resolved [tikguy](https://wordpress.org/support/users/tikguy/)
 * (@tikguy)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/malformed-regex-in-simple-banner-php-breaks-relative-links-by-adding-https/)
 * hey, great job with the plugin. you might wanna consider applying this patch 
   though:
 *     ```wp-block-code
       --- simple-banner.orig	2023-11-30 15:19:16.056016000 +0000
       +++ simple-banner.php	2023-11-30 15:18:26.371711000 +0000
       @@ -648,7 +648,7 @@
        		var style_custom_button_css = document.createElement('style');
   
        		// Banner Text
       -		var hrefRegex = /href\=[\'\"](?!http|https)(.*?)[\'\"]/gsi;
       +		var hrefRegex = /href\=[\'\"](?!http|https)([^\/].*?)[\'\"]/gsi;
        		var scriptStyleRegex = /<(script|style)[^>]*?>.*?<\/(script|style)>/gsi;
        		function stripBannerText(string) {
        			let strippedString = string;
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [rpetersen29](https://wordpress.org/support/users/rpetersen29/)
 * (@rpetersen29)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/malformed-regex-in-simple-banner-php-breaks-relative-links-by-adding-https/#post-17242971)
 * Ah good catch. I’ll add that to the next update.
 *  Plugin Author [rpetersen29](https://wordpress.org/support/users/rpetersen29/)
 * (@rpetersen29)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/malformed-regex-in-simple-banner-php-breaks-relative-links-by-adding-https/#post-17740019)
 * Sorry for the delay on this, added to 2.17.1. Thanks again!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘malformed regex in simple-banner.php breaks relative links by adding 
https://’ is closed to new replies.

 * ![](https://ps.w.org/simple-banner/assets/icon-256x256.png?rev=1198700)
 * [Simple Banner - Easily add multiple Banners/Bars/Notifications/Announcements to the top or bottom of your website](https://wordpress.org/plugins/simple-banner/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-banner/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-banner/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-banner/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-banner/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-banner/reviews/)

## Tags

 * [bug fix](https://wordpress.org/support/topic-tag/bug-fix/)

 * 2 replies
 * 2 participants
 * Last reply from: [rpetersen29](https://wordpress.org/support/users/rpetersen29/)
 * Last activity: [2 years, 1 month ago](https://wordpress.org/support/topic/malformed-regex-in-simple-banner-php-breaks-relative-links-by-adding-https/#post-17740019)
 * Status: resolved