Community Support Forums — WordPress® ( Users Helping Users ) — 2011-12-20T09:50:41-05:00 http://www.primothemes.com/forums/feed.php?f=40&t=13104 2011-12-20T09:50:41-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13104&p=57842#p57842 <![CDATA[s2Member v111220 / Source Code: s2member\i...]]>
s2Member v111220
Source Code: s2member\includes\classes\utils-urls.inc.php
Docs updated: December 20, 2011, 9:50 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — December 20th, 2011, 9:50 am


]]>
2011-12-07T01:03:47-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13104&p=55524#p55524 <![CDATA[s2Member v111206 / Source Code: s2member\i...]]>
s2Member v111206
Source Code: s2member\includes\classes\utils-urls.inc.php
Docs updated: December 7, 2011, 1:03 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — December 7th, 2011, 1:03 am


]]>
2011-11-05T19:26:34-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13104&p=51898#p51898 <![CDATA[s2Member v111105 / Source Code: s2member\i...]]>
s2Member v111105
Source Code: s2member\includes\classes\utils-urls.inc.php
Docs updated: November 5, 2011, 8:26 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — November 5th, 2011, 7:26 pm


]]>
2011-10-29T20:35:55-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13104&p=49993#p49993 <![CDATA[s2Member v111029 / Source Code: s2member\i...]]>
s2Member v111029
Source Code: s2member\includes\classes\utils-urls.inc.php
Docs updated: October 29, 2011, 9:35 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — October 29th, 2011, 8:35 pm


]]>
2011-10-17T15:39:42-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13104&p=47787#p47787 <![CDATA[s2Member v111017 / Source Code: s2member\i...]]>
s2Member v111017
Source Code: s2member\includes\classes\utils-urls.inc.php
Docs updated: October 17, 2011, 1:39 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — October 17th, 2011, 3:39 pm


]]>
2011-10-11T14:35:40-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13104&p=46188#p46188 <![CDATA[s2Member v111011 / Source Code: s2member\i...]]>
s2Member v111011
Source Code: s2member\includes\classes\utils-urls.inc.php
Docs updated: October 11, 2011, 12:35 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — October 11th, 2011, 2:35 pm


]]>
2011-10-03T15:48:05-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13104&p=44318#p44318 <![CDATA[s2Member v111003 / Source Code: s2member\i...]]>
s2Member v111003
Source Code: s2member\includes\classes\utils-urls.inc.php
Docs updated: October 3, 2011, 1:48 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — October 3rd, 2011, 3:48 pm


]]>
2011-10-03T03:41:41-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13104&p=43025#p43025 <![CDATA[s2Member v111002 / Source Code: s2member\i...]]>
s2Member v111002
Source Code: s2member\includes\classes\utils-urls.inc.php
Docs updated: October 3, 2011, 1:41 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — October 3rd, 2011, 3:41 am


]]>
2011-09-27T05:27:00-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13104&p=41271#p41271 <![CDATA[s2Member v110927 / Source Code: s2member\i...]]>
s2Member v110927
Source Code: s2member\includes\classes\utils-urls.inc.php
Docs updated: September 27, 2011, 3:27 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — September 27th, 2011, 5:27 am


]]>
2011-09-26T21:03:37-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13104&p=40027#p40027 <![CDATA[s2Member v110926 / Source Code: s2member\i...]]>
s2Member v110926
Source Code: s2member\includes\classes\utils-urls.inc.php
Docs updated: September 26, 2011, 7:03 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — September 26th, 2011, 9:03 pm


]]>
2011-09-17T16:21:04-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13104&p=38169#p38169 <![CDATA[s2Member v110915 / Source Code: s2member\i...]]>
s2Member v110915
Source Code: s2member\includes\classes\utils-urls.inc.php
Docs updated: September 17, 2011, 2:21 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — September 17th, 2011, 4:21 pm


]]>
2011-09-14T01:28:11-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13104&p=36750#p36750 <![CDATA[s2Member v110913 / Source Code: s2member\i...]]>
s2Member v110913
Source Code: s2member\includes\classes\utils-urls.inc.php
Docs updated: September 13, 2011, 11:28 pm

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — September 14th, 2011, 1:28 am


]]>
2011-09-13T12:03:17-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13104&p=35478#p35478 <![CDATA[s2Member v110912 / Source Code: s2member\i...]]>
s2Member v110912
Source Code: s2member\includes\classes\utils-urls.inc.php
Docs updated: September 13, 2011, 10:03 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — September 13th, 2011, 12:03 pm


]]>
2011-08-15T15:14:42-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13104&p=31598#p31598 <![CDATA[s2Member v110815 / Source Code: s2member\i...]]>
s2Member v110815
Source Code: s2member\includes\classes\utils-urls.inc.php
Docs updated: August 15, 2011, 4:14 pm

Open for public discussion.
(!-- s-words :: --)Source Code Documentation Packages ( Overview ) Classes Deprecated Todo Index Source Code jQuery(window).load(function(){ if(typeof location.hash === 'string' && location.hash.match(/^#/)) jQuery('olli'+location.hash).addClass('hilite'); }); jQuery(window).bind('hashchange', function(){ if(typeof location.hash === 'string' && location.hash.match(/^#/)) jQuery('olli').removeClass('hilite'); jQuery('olli'+location.hash).addClass('hilite'); }); [ full view ]s2member\includes\classes\utils-urls.inc.php ?php /** * URL utilities. * * Copyright: © 2009-2011 * {@link http://www.websharks-inc.com/ WebSharks, Inc.} * ( coded in the USA ) * * Released under the terms of the GNU General Public License. * You should have received a copy of the GNU General Public License, * along with this software. In the main directory, see: /licensing/ * If not, see: {@link http://www.gnu.org/licenses/}. * * @package s2Member\Utilities * @since 3.5 */ if ( realpath ( __FILE__ ) === realpath ( $_SERVER [ "SCRIPT_FILENAME" ] ) ) exit ( "Do not access this file directly." ) ; /**/ if ( ! class_exists ( "c_ws_plugin__s2member_utils_urls" ) ) { /** * URL utilities. * * @package s2Member\Utilities * @since 3.5 */ class c_ws_plugin__s2member_utils_urls { /** * Builds a WordPress® signup URL to `/wp-signup.php`. * * @package s2Member\Utilities * @since 3.5 * * @return str Full URL to `/wp-signup.php`. */ public static function wp_signup_url ( ) /* With Filters. */ { return apply_filters ( "wp_signup_location" , site_url ( "/wp-signup.php" ) ) ; } /** * Builds a WordPress® registration URL to `/wp-login.php?action=register`. * * @package s2Member\Utilities * @since 3.5 * * @param str $redirect_to Optional. Force a specific redirection after registration. * @return str Location of `/wp-login.php?action=register`. */ public static function wp_register_url ( $redirect_to = FALSE ) { return apply_filters ( "wp_register_location" , /* « NOT a core Filter; we're anticipating. */ add_query_arg ( "action" , urlencode ( "register" ) , wp_login_url ( $redirect_to ) ) , get_defined_vars ( ) ) ; } /** * Responsible for all remote communications processed by s2Member. * * Uses ``wp_remote_request()`` through the `WP_Http` class. * This function will try to use cURL first, and then fall back on FOPEN and/or other supported transports. * * @package s2Member\Utilities * @since 3.5 * * @param str $url Full URL with possible query string parameters. * @param str|array $post_vars Optional. Either a string of POST vars, or an array. * @param array $args Optional. An array of additional arguments used by ``wp_remote_request()``. * @param bool $raw Optional. Return raw data w/ headers too? Defaults to false. * @return str|bool The data received in the response from the remote location, else false on failure. */ public static function remote ( $url = FALSE , $post_vars = FALSE , $args = array ( ) , $raw = FALSE ) { static $http_response_filtered = false ; /* Apply GZ filters only once. */ /**/ $args = ( ! is_array ( $args ) ) ? array ( ) : $args ; /* Disable SSL verifications. */ $args [ "sslverify" ] = ( ! isset ( $args [ "sslverify" ] ) ) ? false : $args [ "sslverify" ] ; /**/ if ( ! $http_response_filtered && ( $http_response_filtered = true ) ) add_filter ( "http_response" , "c_ws_plugin__s2member_utils_urls::_remote_gz_variations" ) ; /**/ if ( $url ) /* Obviously, we must have a valid URL before we do anything at all here. */ { if ( preg_match ( "/^https/i" , $url ) && strtolower ( substr ( PHP_OS , 0 , 3 ) ) === "win" ) add_filter ( "use_curl_transport" , "__return_false" , ( $curl_disabled = 1352 ) ) ; /**/ if ( ( is_array ( $post_vars ) || is_string ( $post_vars ) ) && ! empty ( $post_vars ) ) $args = array_merge ( $args , array ( "method" = "POST" , "body" = $post_vars ) ) ; /**/ $response = wp_remote_request ( $url , $args ) ; /* Get response array. */ /**/ if ( $raw && ! ( $r = "" ) ) /* Return a raw response w/ all headers too? */ { foreach ( wp_remote_retrieve_headers ( $response ) as $header = $header_v ) $r .= $header . ": " . $header_v . "\r \n" ; $r = trim ( $r ) . "\r \n \r \n" ; /* Separate headers. */ $r .= wp_remote_retrieve_response_message ( $response ) ; } else /* Else we just retrieve the body. */ $r = wp_remote_retrieve_body ( $response ) ; /**/ if ( $curl_was_disabled_by_this_routine_with_1352_priority = $curl_disabled ) remove_filter ( "use_curl_transport" , "__return_false" , 1352 ) ; /**/ return $r ; /* The return value. */ } /**/ return false ; /* Else return false. */ } /** * Filters the `WP_Http` response for additional gzinflate variations. * * @package s2Member\Utilities * @since 3.5 * * @attaches-to: ``add_filter("http_response");`` * * @param array $response An array of response details. * @return array of ``$response`` details, with possible body modifications. */ public static function _remote_gz_variations ( $response = array ( ) ) { if ( ! isset ( $response [ "ws__gz_variations" ] ) && ( $response [ "ws__gz_variations" ] = 1 ) ) { if ( ! empty ( $response [ "headers" ] [ "content-encoding" ] ) ) if ( ! empty ( $response [ "body" ] ) && substr ( $response [ "body" ] , 0 , 2 ) === "\x78 \x9c" ) if ( ( $gz = @ gzinflate ( substr ( $response [ "body" ] , 2 ) ) ) ) $response [ "body" ] = $gz ; } /**/ return $response ; /* Return response. */ } /** * Filters content redirection status *( uses 302s for browsers )*. * * @package s2Member\Utilities * @since 3.5 * * @attaches-to: ``add_filter("ws_plugin__s2member_content_redirect_status");`` * * @param int|str $status A numeric redirection status code. * @return int|str A numeric status redirection code, possibly modified to a value of `302`. * * @see http://en.wikipedia.org/wiki/Web_browser_engine */ public static function redirect_browsers_using_302_status ( $status = 301 ) { $engines = "msie|trident|gecko|webkit|presto|konqueror|playstation" ; /**/ if ( (int) $status === 301 && ! empty ( $_SERVER [ "HTTP_USER_AGENT" ] ) ) if ( ( $is_browser = preg_match ( "/(" . $engines . ")[\/ ]([0-9\.]+)/i" , $_SERVER [ "HTTP_USER_AGENT" ] ) ) ) return 302 ; /**/ return $status ; /* Else keep existing status code. */ } /** * Parses out a full valid URI, from either a full URL, or a partial. * * @package s2Member\Utilities * @since 3.5 * * @param str $url_or_uri Either a full URL, or a partial URI. * @return str|bool A valid URI, starting with `/` on success, else false. */ public static function parse_uri ( $url_or_uri = FALSE ) { if ( ( $parse = @ parse_url ( $url_or_uri ) ) ) /* See: http://php.net/manual/en/function.parse-url.php. */ { $parse [ "path" ] = ( ! empty ( $parse [ "path" ] ) ) ? ( ( strpos ( $parse [ "path" ] , "/" ) === 0 ) ? $parse [ "path" ] : "/" . $parse [ "path" ] ) : "/" ; $parse [ "path" ] = preg_replace ( "/\/+/" , "/" , $parse [ "path" ] ) ; /* Removes multi slashes. */ /**/ return ( ! empty ( $parse [ "query" ] ) ) ? $parse [ "path" ] . "?" . $parse [ "query" ] : $parse [ "path" ] ; } /**/ return false ; } } } ? [ full view ]s2member\includes\classes\utils-urls.inc.php Source Code Documentation Packages ( Overview ) Classes Deprecated Todo Index Source Code(!-- :: s-words --)

Statistics: Posted by System Robot — August 15th, 2011, 3:14 pm


]]>
2011-07-11T17:30:48-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13104&p=27767#p27767 <![CDATA[s2Member v110710 / Source Code: s2member\i...]]>
s2Member v110710
Source Code: s2member\includes\classes\utils-urls.inc.php
Docs updated: July 11, 2011, 6:30 pm

Open for public discussion.
(!-- s-words :: --)Source Code Documentation Packages ( Overview ) Classes Deprecated Todo Index Source Code jQuery(window).load(function(){ if(typeof location.hash === 'string' && location.hash.match(/^#/)) jQuery('olli'+location.hash).addClass('hilite'); }); jQuery(window).bind('hashchange', function(){ if(typeof location.hash === 'string' && location.hash.match(/^#/)) jQuery('olli').removeClass('hilite'); jQuery('olli'+location.hash).addClass('hilite'); }); [ full view ]s2member\includes\classes\utils-urls.inc.php ?php /** * URL utilities. * * Copyright: © 2009-2011 * {@link http://www.websharks-inc.com/ WebSharks, Inc.} * ( coded in the USA ) * * Released under the terms of the GNU General Public License. * You should have received a copy of the GNU General Public License, * along with this software. In the main directory, see: /licensing/ * If not, see: {@link http://www.gnu.org/licenses/}. * * @package s2Member\Utilities * @since 3.5 */ if ( realpath ( __FILE__ ) === realpath ( $_SERVER [ "SCRIPT_FILENAME" ] ) ) exit ( "Do not access this file directly." ) ; /**/ if ( ! class_exists ( "c_ws_plugin__s2member_utils_urls" ) ) { /** * URL utilities. * * @package s2Member\Utilities * @since 3.5 */ class c_ws_plugin__s2member_utils_urls { /** * Builds a WordPress® signup URL to `/wp-signup.php`. * * @package s2Member\Utilities * @since 3.5 * * @return str Full URL to `/wp-signup.php`. */ public static function wp_signup_url ( ) /* With Filters. */ { return apply_filters ( "wp_signup_location" , site_url ( "/wp-signup.php" ) ) ; } /** * Builds a WordPress® registration URL to `/wp-login.php?action=register`. * * @package s2Member\Utilities * @since 3.5 * * @param str $redirect_to Optional. Force a specific redirection after registration. * @return str Location of `/wp-login.php?action=register`. */ public static function wp_register_url ( $redirect_to = FALSE ) { return apply_filters ( "wp_register_location" , /* « NOT a core Filter; we're anticipating. */ add_query_arg ( "action" , urlencode ( "register" ) , wp_login_url ( $redirect_to ) ) , get_defined_vars ( ) ) ; } /** * Responsible for all remote communications processed by s2Member. * * Uses ``wp_remote_request()`` through the `WP_Http` class. * This function will try to use cURL first, and then fall back on FOPEN and/or other supported transports. * * @package s2Member\Utilities * @since 3.5 * * @param str $url Full URL with possible query string parameters. * @param str|array $post_vars Optional. Either a string of POST vars, or an array. * @param array $args Optional. An array of additional arguments used by ``wp_remote_request()``. * @param bool $raw Optional. Return raw data w/ headers too? Defaults to false. * @return str|bool The data received in the response from the remote location, else false on failure. */ public static function remote ( $url = FALSE , $post_vars = FALSE , $args = array ( ) , $raw = FALSE ) { static $http_response_filtered = false ; /* Apply GZ filters only once. */ /**/ $args = ( ! is_array ( $args ) ) ? array ( ) : $args ; /* Disable SSL verifications. */ $args [ "sslverify" ] = ( ! isset ( $args [ "sslverify" ] ) ) ? false : $args [ "sslverify" ] ; /**/ if ( ! $http_response_filtered && ( $http_response_filtered = true ) ) add_filter ( "http_response" , "c_ws_plugin__s2member_utils_urls::_remote_gz_variations" ) ; /**/ if ( $url ) /* Obviously, we must have a valid URL before we do anything at all here. */ { if ( preg_match ( "/^https/i" , $url ) && strtolower ( substr ( PHP_OS , 0 , 3 ) ) === "win" ) add_filter ( "use_curl_transport" , "__return_false" , ( $curl_disabled = 1352 ) ) ; /**/ if ( ( is_array ( $post_vars ) || is_string ( $post_vars ) ) && ! empty ( $post_vars ) ) $args = array_merge ( $args , array ( "method" = "POST" , "body" = $post_vars ) ) ; /**/ $response = wp_remote_request ( $url , $args ) ; /* Get response array. */ /**/ if ( $raw && ! ( $r = "" ) ) /* Return a raw response w/ all headers too? */ { foreach ( wp_remote_retrieve_headers ( $response ) as $header = $header_v ) $r .= $header . ": " . $header_v . "\r \n" ; $r = trim ( $r ) . "\r \n \r \n" ; /* Separate headers. */ $r .= wp_remote_retrieve_response_message ( $response ) ; } else /* Else we just retrieve the body. */ $r = wp_remote_retrieve_body ( $response ) ; /**/ if ( $curl_was_disabled_by_this_routine_with_1352_priority = $curl_disabled ) remove_filter ( "use_curl_transport" , "__return_false" , 1352 ) ; /**/ return $r ; /* The return value. */ } /**/ return false ; /* Else return false. */ } /** * Filters the `WP_Http` response for additional gzinflate variations. * * @package s2Member\Utilities * @since 3.5 * * @attaches-to: ``add_filter("http_response");`` * * @param array $response An array of response details. * @return array of ``$response`` details, with possible body modifications. */ public static function _remote_gz_variations ( $response = array ( ) ) { if ( ! isset ( $response [ "ws__gz_variations" ] ) && ( $response [ "ws__gz_variations" ] = 1 ) ) { if ( ! empty ( $response [ "headers" ] [ "content-encoding" ] ) ) if ( ! empty ( $response [ "body" ] ) && substr ( $response [ "body" ] , 0 , 2 ) === "\x78 \x9c" ) if ( ( $gz = @ gzinflate ( substr ( $response [ "body" ] , 2 ) ) ) ) $response [ "body" ] = $gz ; } /**/ return $response ; /* Return response. */ } /** * Filters content redirection status *( uses 302s for browsers )*. * * @package s2Member\Utilities * @since 3.5 * * @attaches-to: ``add_filter("ws_plugin__s2member_content_redirect_status");`` * * @param int|str $status A numeric redirection status code. * @return int|str A numeric status redirection code, possibly modified to a value of `302`. * * @see http://en.wikipedia.org/wiki/Web_browser_engine */ public static function redirect_browsers_using_302_status ( $status = 301 ) { $engines = "msie|trident|gecko|webkit|presto|konqueror|playstation" ; /**/ if ( (int) $status === 301 && ! empty ( $_SERVER [ "HTTP_USER_AGENT" ] ) ) if ( ( $is_browser = preg_match ( "/(" . $engines . ")[\/ ]([0-9\.]+)/i" , $_SERVER [ "HTTP_USER_AGENT" ] ) ) ) return 302 ; /**/ return $status ; /* Else keep existing status code. */ } /** * Parses out a full valid URI, from either a full URL, or a partial. * * @package s2Member\Utilities * @since 3.5 * * @param str $url_or_uri Either a full URL, or a partial URI. * @return str|bool A valid URI, starting with `/` on success, else false. */ public static function parse_uri ( $url_or_uri = FALSE ) { if ( ( $parse = @ parse_url ( $url_or_uri ) ) ) /* See: http://php.net/manual/en/function.parse-url.php. */ { $parse [ "path" ] = ( ! empty ( $parse [ "path" ] ) ) ? ( ( strpos ( $parse [ "path" ] , "/" ) === 0 ) ? $parse [ "path" ] : "/" . $parse [ "path" ] ) : "/" ; $parse [ "path" ] = preg_replace ( "/\/+/" , "/" , $parse [ "path" ] ) ; /* Removes multi slashes. */ /**/ return ( ! empty ( $parse [ "query" ] ) ) ? $parse [ "path" ] . "?" . $parse [ "query" ] : $parse [ "path" ] ; } /**/ return false ; } } } ? [ full view ]s2member\includes\classes\utils-urls.inc.php Source Code Documentation Packages ( Overview ) Classes Deprecated Todo Index Source Code(!-- :: s-words --)

Statistics: Posted by System Robot — July 11th, 2011, 5:30 pm


]]>
2011-07-09T06:10:44-05:00 http://www.primothemes.com/forums/viewtopic.php?t=13104&p=25399#p25399 <![CDATA[s2Member v111220 / Source Code: s2member\i...]]>
s2Member v111220
Source Code: s2member\includes\classes\utils-urls.inc.php
Docs updated: December 20, 2011, 9:50 am

Open for public discussion.
(!-- s-words :: --)n/a(!-- :: s-words --)

Statistics: Posted by System Robot — July 9th, 2011, 6:10 am


]]>