Changeset 2005379
- Timestamp:
- 01/02/2019 09:59:15 PM (6 years ago)
- Location:
- unbounce
- Files:
-
- 14 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
unbounce/tags/1.0.43/UBConfig.php
r1987253 r2005379 6 6 const UB_PLUGIN_NAME = 'ub-wordpress'; 7 7 const UB_CACHE_TIMEOUT_ENV_KEY = 'UB_WP_ROUTES_CACHE_EXP'; 8 const UB_USER_AGENT = 'Unbounce WP Plugin 1.0.4 2';9 const UB_VERSION = '1.0.4 2';8 const UB_USER_AGENT = 'Unbounce WP Plugin 1.0.43'; 9 const UB_VERSION = '1.0.43'; 10 10 11 11 // Option keys -
unbounce/tags/1.0.43/UBDiagnostics.php
r1987253 r2005379 101 101 'PHP Version' => phpversion(), 102 102 'WordPress Version' => UBDiagnostics::wordpress_version(), 103 'Unbounce Plugin Version' => '1.0.4 2',103 'Unbounce Plugin Version' => '1.0.43', 104 104 'Checks' => self::pp(UBDiagnostics::checks($domain, $domain_info)), 105 105 'Options' => self::pp(UBDiagnostics::ub_options()), … … 179 179 'php' => phpversion(), 180 180 'wordpress' => UBDiagnostics::wordpress_version(), 181 'plugin_version' => '1.0.4 2',181 'plugin_version' => '1.0.43', 182 182 'curl_installed' => self::is_curl_installed(), 183 183 'xml_installed' => self::is_xml_installed(), -
unbounce/tags/1.0.43/UBHTTP.php
r1987253 r2005379 13 13 public static $response_header_whitelist = '/^(Content-Type:|Location:|Link:|Content-Location:|Set-Cookie:|X-Server-Instance:|X-Unbounce-PageId:|X-Unbounce-Variant:|X-Unbounce-VisitorID:)/i'; 14 14 public static $request_header_blacklist = '/^(Accept-Encoding:)/i'; 15 public static $location_header_regex = '/^(Location:)/i'; 15 16 public static $cookie_whitelist = array('ubvs', 'ubpv', 'ubvt', 'hubspotutk'); 16 17 … … 246 247 public static function sanitize_cookies($headers) 247 248 { 249 $cookie_key = "Cookie"; 250 if (!array_key_exists($cookie_key, $headers)) { 251 $cookie_key = "cookie"; // fallback to trying lowercase 252 if (!array_key_exists($cookie_key, $headers)) { 253 return $headers; 254 } 255 } 256 248 257 $cookies_to_forward = UBUtil::array_select_by_key( 249 UBHTTP::cookie_array_from_string($headers[ "Cookie"]),258 UBHTTP::cookie_array_from_string($headers[$cookie_key]), 250 259 UBHTTP::$cookie_whitelist 251 260 ); 252 261 if (sizeof($cookies_to_forward) > 0) { 253 $headers[ "Cookie"] = UBHTTP::cookie_string_from_array($cookies_to_forward);262 $headers[$cookie_key] = UBHTTP::cookie_string_from_array($cookies_to_forward); 254 263 } 255 264 return $headers; … … 324 333 $message = "Error proxying to '" . $target_url . "': " . curl_error($curl) . " - Code: " . curl_errno($curl); 325 334 UBLogger::warning($message); 326 http_response_code(500); 327 $result = array(false, $message); 335 if (UBHTTP::is_location_response_header_set()) { 336 UBLogger::debug("The location header was set despite the cURL error. Assuming it's safe to let the response flow back"); 337 $result = array(true, null); 338 } else { 339 http_response_code(500); 340 $result = array(false, $message); 341 } 328 342 } else { 329 343 $result = array(true, null); … … 333 347 334 348 return $result; 349 } 350 351 private static function is_location_response_header_set() 352 { 353 $resp_headers = headers_list(); 354 foreach ($resp_headers as $value) { //headers at this point are raw strings, not K -> V 355 if (preg_match(UBHTTP::$location_header_regex, $value)) { 356 return true; 357 } 358 } 359 return false; 335 360 } 336 361 -
unbounce/tags/1.0.43/Unbounce-Page.php
r1987253 r2005379 4 4 Plugin URI: http://unbounce.com 5 5 Description: Unbounce is the most powerful standalone landing page builder available. 6 Version: 1.0.4 26 Version: 1.0.43 7 7 Author: Unbounce 8 8 Author URI: http://unbounce.com -
unbounce/tags/1.0.43/readme.txt
r1987253 r2005379 4 4 Requires at least: 4.1.5 5 5 Tested up to: 5.0 6 Stable tag: 1.0.4 26 Stable tag: 1.0.43 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 101 101 == Changelog == 102 102 103 = 1.0.43= 104 * Fixes an issue handling cookies 105 * Fixes an issue handling redirects 106 103 107 = 1.0.42 = 104 108 * Fixes an issue causing older versions of PHP to get a 404 when visiting pages -
unbounce/tags/1.0.43/templates/main_authorized_footer.php
r1987253 r2005379 22 22 Click here for troubleshooting and plugin diagnostics 23 23 </a> 24 <p class="ub-version">Unbounce Version 1.0.4 2</p>24 <p class="ub-version">Unbounce Version 1.0.43</p> -
unbounce/tags/1.0.43/templates/main_unauthorized_footer.php
r1987253 r2005379 5 5 Click here for troubleshooting and plugin diagnostics 6 6 </a> 7 <p class="ub-version">Unbounce Version 1.0.4 2</p>7 <p class="ub-version">Unbounce Version 1.0.43</p> -
unbounce/trunk/UBConfig.php
r1987253 r2005379 6 6 const UB_PLUGIN_NAME = 'ub-wordpress'; 7 7 const UB_CACHE_TIMEOUT_ENV_KEY = 'UB_WP_ROUTES_CACHE_EXP'; 8 const UB_USER_AGENT = 'Unbounce WP Plugin 1.0.4 2';9 const UB_VERSION = '1.0.4 2';8 const UB_USER_AGENT = 'Unbounce WP Plugin 1.0.43'; 9 const UB_VERSION = '1.0.43'; 10 10 11 11 // Option keys -
unbounce/trunk/UBDiagnostics.php
r1987253 r2005379 101 101 'PHP Version' => phpversion(), 102 102 'WordPress Version' => UBDiagnostics::wordpress_version(), 103 'Unbounce Plugin Version' => '1.0.4 2',103 'Unbounce Plugin Version' => '1.0.43', 104 104 'Checks' => self::pp(UBDiagnostics::checks($domain, $domain_info)), 105 105 'Options' => self::pp(UBDiagnostics::ub_options()), … … 179 179 'php' => phpversion(), 180 180 'wordpress' => UBDiagnostics::wordpress_version(), 181 'plugin_version' => '1.0.4 2',181 'plugin_version' => '1.0.43', 182 182 'curl_installed' => self::is_curl_installed(), 183 183 'xml_installed' => self::is_xml_installed(), -
unbounce/trunk/UBHTTP.php
r1987253 r2005379 13 13 public static $response_header_whitelist = '/^(Content-Type:|Location:|Link:|Content-Location:|Set-Cookie:|X-Server-Instance:|X-Unbounce-PageId:|X-Unbounce-Variant:|X-Unbounce-VisitorID:)/i'; 14 14 public static $request_header_blacklist = '/^(Accept-Encoding:)/i'; 15 public static $location_header_regex = '/^(Location:)/i'; 15 16 public static $cookie_whitelist = array('ubvs', 'ubpv', 'ubvt', 'hubspotutk'); 16 17 … … 246 247 public static function sanitize_cookies($headers) 247 248 { 249 $cookie_key = "Cookie"; 250 if (!array_key_exists($cookie_key, $headers)) { 251 $cookie_key = "cookie"; // fallback to trying lowercase 252 if (!array_key_exists($cookie_key, $headers)) { 253 return $headers; 254 } 255 } 256 248 257 $cookies_to_forward = UBUtil::array_select_by_key( 249 UBHTTP::cookie_array_from_string($headers[ "Cookie"]),258 UBHTTP::cookie_array_from_string($headers[$cookie_key]), 250 259 UBHTTP::$cookie_whitelist 251 260 ); 252 261 if (sizeof($cookies_to_forward) > 0) { 253 $headers[ "Cookie"] = UBHTTP::cookie_string_from_array($cookies_to_forward);262 $headers[$cookie_key] = UBHTTP::cookie_string_from_array($cookies_to_forward); 254 263 } 255 264 return $headers; … … 324 333 $message = "Error proxying to '" . $target_url . "': " . curl_error($curl) . " - Code: " . curl_errno($curl); 325 334 UBLogger::warning($message); 326 http_response_code(500); 327 $result = array(false, $message); 335 if (UBHTTP::is_location_response_header_set()) { 336 UBLogger::debug("The location header was set despite the cURL error. Assuming it's safe to let the response flow back"); 337 $result = array(true, null); 338 } else { 339 http_response_code(500); 340 $result = array(false, $message); 341 } 328 342 } else { 329 343 $result = array(true, null); … … 333 347 334 348 return $result; 349 } 350 351 private static function is_location_response_header_set() 352 { 353 $resp_headers = headers_list(); 354 foreach ($resp_headers as $value) { //headers at this point are raw strings, not K -> V 355 if (preg_match(UBHTTP::$location_header_regex, $value)) { 356 return true; 357 } 358 } 359 return false; 335 360 } 336 361 -
unbounce/trunk/Unbounce-Page.php
r1987253 r2005379 4 4 Plugin URI: http://unbounce.com 5 5 Description: Unbounce is the most powerful standalone landing page builder available. 6 Version: 1.0.4 26 Version: 1.0.43 7 7 Author: Unbounce 8 8 Author URI: http://unbounce.com -
unbounce/trunk/readme.txt
r1987253 r2005379 4 4 Requires at least: 4.1.5 5 5 Tested up to: 5.0 6 Stable tag: 1.0.4 26 Stable tag: 1.0.43 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 101 101 == Changelog == 102 102 103 = 1.0.43= 104 * Fixes an issue handling cookies 105 * Fixes an issue handling redirects 106 103 107 = 1.0.42 = 104 108 * Fixes an issue causing older versions of PHP to get a 404 when visiting pages -
unbounce/trunk/templates/main_authorized_footer.php
r1987253 r2005379 22 22 Click here for troubleshooting and plugin diagnostics 23 23 </a> 24 <p class="ub-version">Unbounce Version 1.0.4 2</p>24 <p class="ub-version">Unbounce Version 1.0.43</p> -
unbounce/trunk/templates/main_unauthorized_footer.php
r1987253 r2005379 5 5 Click here for troubleshooting and plugin diagnostics 6 6 </a> 7 <p class="ub-version">Unbounce Version 1.0.4 2</p>7 <p class="ub-version">Unbounce Version 1.0.43</p>
Note: See TracChangeset
for help on using the changeset viewer.