Plugin Directory

Changeset 2005379


Ignore:
Timestamp:
01/02/2019 09:59:15 PM (6 years ago)
Author:
unbouncewordpress
Message:

Releasing version 1.0.43

Location:
unbounce
Files:
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • unbounce/tags/1.0.43/UBConfig.php

    r1987253 r2005379  
    66    const UB_PLUGIN_NAME           = 'ub-wordpress';
    77    const UB_CACHE_TIMEOUT_ENV_KEY = 'UB_WP_ROUTES_CACHE_EXP';
    8     const UB_USER_AGENT            = 'Unbounce WP Plugin 1.0.42';
    9     const UB_VERSION               = '1.0.42';
     8    const UB_USER_AGENT            = 'Unbounce WP Plugin 1.0.43';
     9    const UB_VERSION               = '1.0.43';
    1010
    1111  // Option keys
  • unbounce/tags/1.0.43/UBDiagnostics.php

    r1987253 r2005379  
    101101        'PHP Version'             => phpversion(),
    102102        'WordPress Version'       => UBDiagnostics::wordpress_version(),
    103         'Unbounce Plugin Version' => '1.0.42',
     103        'Unbounce Plugin Version' => '1.0.43',
    104104        'Checks'                  => self::pp(UBDiagnostics::checks($domain, $domain_info)),
    105105        'Options'                 => self::pp(UBDiagnostics::ub_options()),
     
    179179            'php'                 => phpversion(),
    180180            'wordpress'           => UBDiagnostics::wordpress_version(),
    181             'plugin_version'      => '1.0.42',
     181            'plugin_version'      => '1.0.43',
    182182            'curl_installed'      => self::is_curl_installed(),
    183183            'xml_installed'       => self::is_xml_installed(),
  • unbounce/tags/1.0.43/UBHTTP.php

    r1987253 r2005379  
    1313    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';
    1414    public static $request_header_blacklist = '/^(Accept-Encoding:)/i';
     15    public static $location_header_regex = '/^(Location:)/i';
    1516    public static $cookie_whitelist = array('ubvs', 'ubpv', 'ubvt', 'hubspotutk');
    1617
     
    246247    public static function sanitize_cookies($headers)
    247248    {
     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
    248257        $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]),
    250259            UBHTTP::$cookie_whitelist
    251260        );
    252261        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);
    254263        }
    255264        return $headers;
     
    324333            $message = "Error proxying to '" . $target_url . "': " . curl_error($curl) . " - Code: " . curl_errno($curl);
    325334            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            }
    328342        } else {
    329343            $result = array(true, null);
     
    333347
    334348        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;
    335360    }
    336361
  • unbounce/tags/1.0.43/Unbounce-Page.php

    r1987253 r2005379  
    44Plugin URI: http://unbounce.com
    55Description: Unbounce is the most powerful standalone landing page builder available.
    6 Version: 1.0.42
     6Version: 1.0.43
    77Author: Unbounce
    88Author URI: http://unbounce.com
  • unbounce/tags/1.0.43/readme.txt

    r1987253 r2005379  
    44Requires at least: 4.1.5
    55Tested up to: 5.0
    6 Stable tag: 1.0.42
     6Stable tag: 1.0.43
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    101101== Changelog ==
    102102
     103= 1.0.43=
     104* Fixes an issue handling cookies
     105* Fixes an issue handling redirects
     106
    103107= 1.0.42 =
    104108* 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  
    2222  Click here for troubleshooting and plugin diagnostics
    2323</a>
    24 <p class="ub-version">Unbounce Version 1.0.42</p>
     24<p class="ub-version">Unbounce Version 1.0.43</p>
  • unbounce/tags/1.0.43/templates/main_unauthorized_footer.php

    r1987253 r2005379  
    55  Click here for troubleshooting and plugin diagnostics
    66</a>
    7 <p class="ub-version">Unbounce Version 1.0.42</p>
     7<p class="ub-version">Unbounce Version 1.0.43</p>
  • unbounce/trunk/UBConfig.php

    r1987253 r2005379  
    66    const UB_PLUGIN_NAME           = 'ub-wordpress';
    77    const UB_CACHE_TIMEOUT_ENV_KEY = 'UB_WP_ROUTES_CACHE_EXP';
    8     const UB_USER_AGENT            = 'Unbounce WP Plugin 1.0.42';
    9     const UB_VERSION               = '1.0.42';
     8    const UB_USER_AGENT            = 'Unbounce WP Plugin 1.0.43';
     9    const UB_VERSION               = '1.0.43';
    1010
    1111  // Option keys
  • unbounce/trunk/UBDiagnostics.php

    r1987253 r2005379  
    101101        'PHP Version'             => phpversion(),
    102102        'WordPress Version'       => UBDiagnostics::wordpress_version(),
    103         'Unbounce Plugin Version' => '1.0.42',
     103        'Unbounce Plugin Version' => '1.0.43',
    104104        'Checks'                  => self::pp(UBDiagnostics::checks($domain, $domain_info)),
    105105        'Options'                 => self::pp(UBDiagnostics::ub_options()),
     
    179179            'php'                 => phpversion(),
    180180            'wordpress'           => UBDiagnostics::wordpress_version(),
    181             'plugin_version'      => '1.0.42',
     181            'plugin_version'      => '1.0.43',
    182182            'curl_installed'      => self::is_curl_installed(),
    183183            'xml_installed'       => self::is_xml_installed(),
  • unbounce/trunk/UBHTTP.php

    r1987253 r2005379  
    1313    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';
    1414    public static $request_header_blacklist = '/^(Accept-Encoding:)/i';
     15    public static $location_header_regex = '/^(Location:)/i';
    1516    public static $cookie_whitelist = array('ubvs', 'ubpv', 'ubvt', 'hubspotutk');
    1617
     
    246247    public static function sanitize_cookies($headers)
    247248    {
     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
    248257        $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]),
    250259            UBHTTP::$cookie_whitelist
    251260        );
    252261        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);
    254263        }
    255264        return $headers;
     
    324333            $message = "Error proxying to '" . $target_url . "': " . curl_error($curl) . " - Code: " . curl_errno($curl);
    325334            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            }
    328342        } else {
    329343            $result = array(true, null);
     
    333347
    334348        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;
    335360    }
    336361
  • unbounce/trunk/Unbounce-Page.php

    r1987253 r2005379  
    44Plugin URI: http://unbounce.com
    55Description: Unbounce is the most powerful standalone landing page builder available.
    6 Version: 1.0.42
     6Version: 1.0.43
    77Author: Unbounce
    88Author URI: http://unbounce.com
  • unbounce/trunk/readme.txt

    r1987253 r2005379  
    44Requires at least: 4.1.5
    55Tested up to: 5.0
    6 Stable tag: 1.0.42
     6Stable tag: 1.0.43
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    101101== Changelog ==
    102102
     103= 1.0.43=
     104* Fixes an issue handling cookies
     105* Fixes an issue handling redirects
     106
    103107= 1.0.42 =
    104108* Fixes an issue causing older versions of PHP to get a 404 when visiting pages
  • unbounce/trunk/templates/main_authorized_footer.php

    r1987253 r2005379  
    2222  Click here for troubleshooting and plugin diagnostics
    2323</a>
    24 <p class="ub-version">Unbounce Version 1.0.42</p>
     24<p class="ub-version">Unbounce Version 1.0.43</p>
  • unbounce/trunk/templates/main_unauthorized_footer.php

    r1987253 r2005379  
    55  Click here for troubleshooting and plugin diagnostics
    66</a>
    7 <p class="ub-version">Unbounce Version 1.0.42</p>
     7<p class="ub-version">Unbounce Version 1.0.43</p>
Note: See TracChangeset for help on using the changeset viewer.