Skip to content

Commit

Permalink
Update pat_if_amp.php
Browse files Browse the repository at this point in the history
Fix a misunderstood with some too closest words of 'amp' into URLs (e.g. 'camp'). Thank you Heather.
  • Loading branch information
cara-tm authored Apr 21, 2018
1 parent 7acd8b7 commit f856ba0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pat_if_amp.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -78,7 +78,7 @@
* @type: Public
* @prefs: no
* @order: 5
* @version: 0.3.6
* @version: 0.3.7
* @license: GPLv2
*/

Expand Down Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit f856ba0

Please sign in to comment.