From f856ba096514d4daeffe7426904ddf6c3dd6b19d Mon Sep 17 00:00:00 2001 From: Patrick LEFEVRE Date: Sat, 21 Apr 2018 20:28:19 +0200 Subject: [PATCH] Update pat_if_amp.php Fix a misunderstood with some too closest words of 'amp' into URLs (e.g. 'camp'). Thank you Heather. --- pat_if_amp.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pat_if_amp.php b/pat_if_amp.php index 29ec9d3..97a7145 100644 --- a/pat_if_amp.php +++ b/pat_if_amp.php @@ -17,7 +17,7 @@ // 1 = Plugin help is in raw HTML. Not recommended. # $plugin['allow_html_help'] = 1; -$plugin['version'] = '0.3.6'; +$plugin['version'] = '0.3.7'; $plugin['author'] = 'Patrick LEFEVRE (original idea by Michael K Pate)'; $plugin['author_uri'] = 'https://github.com/cara-tm/'; $plugin['description'] = 'AMP pages for Textpattern CMS'; @@ -78,7 +78,7 @@ * @type: Public * @prefs: no * @order: 5 - * @version: 0.3.6 + * @version: 0.3.7 * @license: GPLv2 */ @@ -112,7 +112,7 @@ function pat_if_amp_init() global $variable; // Initiates a TXP variable which sniffs for 'amp' (with or without a final backslash) in URLs or a simple query '?amp' - $variable['pat_amp'] = (preg_match( '/amp/', $GLOBALS['pretext']['request_uri'] ) || gps('amp') ? 1 : 0 ); + $variable['pat_amp'] = (preg_match( '/[\/\?](amp)/s', $GLOBALS['pretext']['request_uri']) || gps('amp') ? 1 : 0); } /**