PHP Warning
-
Hi there,
I noticed a PHP Warning in my debug log:PHP Warning: preg_match(): Unknown modifier ‘t’ in /home/comicboo/public_html/wp-content/plugins/wp-lister-ebay/classes/core/WPL_Core.php on line 138
AI recommended this fix, but I don’t intend on changing any plugin files, thought I should share in case you were unaware of the php warning 🙂
Line 138:
if ( preg_match( “/$staging_site_pattern/”, $url ) ) { return true; }
The variable
$staging_site_patternlikely contains a URL or a file path (e.g.,staging/site). Because the code uses forward slashes/as delimiters, the first/found inside your URL/path terminates the expression, and the character immediately following it (thetinhttp://orstaging/site) is treated as an invalid modifier [1, 2].To fix this, change the delimiters to a character that won’t appear in a URL, such as
#.The Fix
Replace the code in
/home/comicboo/public_html/wp-content/plugins/wp-lister-ebay/classes/core/WPL_Core.phpon line 138 with this:if ( preg_match( "#" . preg_quote($staging_site_pattern, '#') . "#", $url ) ) { return true; }Cheers
You must be logged in to reply to this topic.