https://github.com/gocom/rah_gps
Extract HTTP POST/GET values as Textpattern's variables
https://github.com/gocom/rah_gps
Last synced: about 1 year ago
JSON representation
Extract HTTP POST/GET values as Textpattern's variables
- Host: GitHub
- URL: https://github.com/gocom/rah_gps
- Owner: gocom
- License: gpl-2.0
- Created: 2012-01-29T15:06:36.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2012-06-20T18:40:15.000Z (almost 14 years ago)
- Last Synced: 2025-01-26T11:08:32.179Z (over 1 year ago)
- Language: PHP
- Homepage:
- Size: 101 KB
- Stars: 0
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.textile
- License: LICENSE
Awesome Lists containing this project
README
h1. rah_gps
p. A plugin for "Textpattern CMS":http://www.textpattern.com. Extracts HTTP POST/GET variables as Textpattern's "variables":http://textpattern.net/wiki/index.php?title=variable tags.
p. Rah_gps project is based on "Adi Gilbert":http://www.greatoceanmedia.com.au/'s great work on "adi_gps":http://forum.textpattern.com/viewtopic.php?id=28932. The project orginates from a security patch (for adi_gps) that was sent to Adi in the late 2011. As of January 29, 2011 this patch hasn't been released, and therefor "I'm":http://twitter.com/gocom, giving my own taken into POST and GET extracting and trying to do it as securely as possible. In a form of new rah plugin. I personally hope that Adi can get some free time and release updated version of adi_gps.
p. Feature-wise rah_gps isn't 1on1 identical with adi_gps. Apart from security fixes, it also has, in a sense, less features. For example, it has no global extracting, it can not overwrite variables anonymously and the included tag itself never returns anything.
h2. Requirements
p. Rah_gps at minimum requires:
* Textpattern v4.5.0 or newer.
h2. Attributes
p. The tag, @@, is a single, self-closing tag. It's used to export POST and GET values as variables. The tag itself doesn't return anything. Attributes for it follow.
p. *name*
Comma-separated list of HTTP POST/GET parameters to export. If not defined (left empty), all requested paramaters are exported as variables, expect for those that already exists as variables. Already existing variables are not overwritten when @name@ is not specified.
Default: @undefined@ Example: @name="q, page, form_id, location"@
p. *escape*
If set to @1@, extracted POST/GET values are escaped from Textpattern and HTML markup, and special characters are converted to HTML entities. By default this option is on (@1@), and usually it should not be turned off. Never set @escape@ to @0@ (off) if you plan to return the values on your page template.
Default: @escape="1"@ Example: @"0"@
p. *type*
Where to get the values, from POST or GET requests. Available values are @gps@ and @ps@. If set to @ps@ values are retrieved from POST. If set to @gps@ values are retrieved from GET, and from POST if they are not first found in GET.
Default: @type="gps"@ Example: @"ps"@
p. *new*
If defined, extracted variables are renamed to the given value. Only works when extracting sinle variable. If @new@ is used when extracting multiple values, only one variable will be created and populated with the last value.
Default: @new=""@ Example: @"private_id"@
h2. Examples
h3. Example: #1: Extracting all GET/POST values
bc.
p. If requested page's URL is @?location=foobar&pid=barfoo@, above would create and populate two variables,
@@ and @@.
h3. Example #2: Extract only specific values
bc.
p. Above would export GET/POST values values @foo@ and @bar@, and create two new "variables":http://textpattern.net/wiki/index.php?title=variable named @foo@ and @bar@.