PluginProbe
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments / 4.7.0
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments v4.7.0
4.7.2 4.7.1 4.7.0 4.6.6 4.6.5 4.6.4 4.6.3 4.6.2 4.6.1 4.6.0 4.5.1 4.5.0 4.4.2 4.4.1 4.4.0 4.3.3 4.3.2 4.3.1 4.3.0 4.2.3 4.2.2 4.2.1 1.0.3 1.0.4 1.0.5 All 281 releases
surecart / app / helpers / route-helper.php
route-helper.php
25 lines 728 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Handles a url $_GET request.
5 *
6 * @param string $var Url variable value.
7 * @param string $name Name of URL var.
8 */
9 function sc_url_var( $var, $name = 'action' ) {
10 // it's empty if it's not set or it's set to -1.
11 if ( ! $var ) return empty( $_GET[ $name ] ) || '-1' === $_GET[ $name ]; // phpcs:ignore
12 return ! empty( $_GET[ $name ] ) && $var === $_GET[ $name ]; // phpcs:ignore
13 }
14
15 /**
16 * Handles a url $_GET request for sc_action.
17 *
18 * @param string $var Url variable value.
19 * @param string $name Name of URL var.
20 */
21 function sc_action( $var, $name = 'sc-action' ) {
22 if ( ! $var ) return empty( $_GET[$name] ); // phpcs:ignore
23 return ! empty( $_GET[$name] ) && $var === $_GET[$name]; // phpcs:ignore
24 }
25