Plugin Directory

Changeset 2852524


Ignore:
Timestamp:
01/22/2023 11:46:31 AM (3 years ago)
Author:
zinoui
Message:

Version 1.18.6

Location:
http-headers/trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • http-headers/trunk/README.txt

    r2524185 r2852524  
    11=== HTTP Headers ===
    22Contributors: zinoui
    3 Donate link: https://zinoui.com/donation
     3Donate link: https://paypal.me/Dimitar81
    44Tags: custom headers, http headers, headers, security, http header, header, cross domain, cors, xss, clickjacking, mitm, cross origin, cross site, privacy, p3p, hsts, referrer, csp, caching, compression, access control, authentication
    55Requires at least: 3.2
    6 Tested up to: 5.7.1
     6Tested up to: 6.1.1
    77Requires PHP: 5.3
    8 Stable tag: 1.18.5
     8Stable tag: 1.18.6
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    5858- X-XSS-Protection
    5959
    60 The [getting started tutorial](https://zinoui.com/blog/http-headers-for-wordpress) describes a typical configuration of this plugin.
    61 
    6260== Installation ==
    6361
     
    8886
    8987== Changelog ==
     88
     89= 1.18.6 =
     90*Release Date - 22nd January, 2023*
     91
     92* PHP 8 compatibility changes
    9093
    9194= 1.18.5 =
  • http-headers/trunk/http-headers.php

    r2524185 r2852524  
    22/*
    33Plugin Name: HTTP Headers
    4 Plugin URI: https://zinoui.com/blog/http-headers-for-wordpress
     4Plugin URI: https://github.com/riverside/http-headers
    55Description: A plugin for HTTP headers management including security, access-control (CORS), caching, compression, and authentication.
    6 Version: 1.18.5
     6Version: 1.18.6
    77Author: Dimitar Ivanov
    8 Author URI: https://zinoui.com
     8Author URI: https://github.com/riverside
    99License: GPLv2 or later
    1010Text Domain: http-headers
     
    2525along with this program. If not, see <http://www.gnu.org/copyleft/gpl.html>.
    2626
    27 Copyright (c) 2017-2021 Zino UI
     27Copyright (c) 2017-2023 Dimitar Ivanov
    2828*/
    2929
     
    4040
    4141function build_csp_value($value) {
     42    if (!is_array($value))
     43    {
     44        return NULL;
     45    }
    4246    $csp = array();
    4347    foreach ($value as $key => $val)
     
    452456    $nel = get_option('hh_nel_value', array());
    453457    return sprintf('{"report_to": "%s", "max_age": %u%s%s%s%s%s}',
    454         @$nel['report_to'], @$nel['max_age'],
     458        isset($nel['report_to']) ? $nel['report_to'] : NULL,
     459        isset($nel['max_age']) ? $nel['max_age'] : NULL,
    455460        isset($nel['include_subdomains']) ? ', "include_subdomains": true' : NULL,
    456461        array_key_exists('success_fraction', $nel) && is_numeric($nel['success_fraction']) ? ', "success_fraction": '. $nel['success_fraction'] : NULL,
     
    11721177        $types = get_option('hh_expires_type', array());
    11731178        $values = get_option('hh_expires_value', array());
     1179        if (!is_array($types))
     1180        {
     1181            $types = array();
     1182        }
     1183        if (!is_array($values))
     1184        {
     1185            $values = array();
     1186        }
    11741187       
    11751188        $lines[] = '<IfModule mod_expires.c>';
  • http-headers/trunk/views/access-control-allow-origin.php

    r2233507 r2852524  
    5151                    </select>
    5252                </td>
    53                 <td class="hh-acao<?php echo $access_control_allow_origin_value != 'origin' ? ' hh-hidden' : NULL; ?>"><input type="text" name="hh_access_control_allow_origin_url[]" class="http-header-value" placeholder="http://domain.com" size="35" value="<?php echo esc_attr(@$access_control_allow_origin_url[0]); ?>"<?php echo $access_control_allow_origin == 1 && $access_control_allow_origin_value == 'origin' ? NULL : ' readonly'; ?> /></td>
     53                <td class="hh-acao<?php echo $access_control_allow_origin_value != 'origin' ? ' hh-hidden' : NULL; ?>">
     54                    <input type="text" name="hh_access_control_allow_origin_url[]" class="http-header-value"
     55                           placeholder="http://domain.com" size="35"
     56                           value="<?php echo isset($access_control_allow_origin_url[0]) ? esc_attr($access_control_allow_origin_url[0]) : NULL; ?>"<?php echo $access_control_allow_origin == 1 && $access_control_allow_origin_value == 'origin' ? NULL : ' readonly'; ?> />
     57                </td>
    5458                <td class="hh-acao<?php echo $access_control_allow_origin_value != 'origin' ? ' hh-hidden' : NULL; ?>">&nbsp;</td>
    5559            </tr>
  • http-headers/trunk/views/ajax-inspect.php

    r2408845 r2852524  
    9898        && !(in_array($k, $special) && array_key_exists($k . '-report-only', $responseHeaders) ))
    9999    {
    100         $missing[$k] = @$categories[$v[2]];
     100        $missing[$k] = isset($categories[$v[2]]) ? $categories[$v[2]] : 'Other';
    101101    }
    102102}
  • http-headers/trunk/views/category.php

    r2523948 r2852524  
    1919    foreach ($headers as $index => $item)
    2020    {
    21         if (@$_GET['category'] != $item[2])
     21        if ($_GET['category'] != $item[2])
    2222        {
    2323            continue;
  • http-headers/trunk/views/content-security-policy.php

    r2523948 r2852524  
    1818        <p class="description">Useful tools:</p>
    1919        <p class="description">
    20             <a target="_blank" href="https://zinoui.com/tools/sri-generator">SRI Hash Generator</a>
     20            <a target="_blank" href="https://report-uri.com/home/sri_hash">SRI Hash Generator</a>
    2121            - generates subresource integrity hashes using a cryptographic algorithm.
    2222        </p>
    2323        <p class="description">
    24             <a target="_blank" href="https://zinoui.com/tools/csp-hash">CSP Hash Generator</a>
     24            <a target="_blank" href="https://report-uri.com/home/hash">CSP Hash Generator</a>
    2525            - generates CSP hashes to use in script-src and style-src directives.
    2626        </p>
  • http-headers/trunk/views/dashboard.php

    r1797246 r2852524  
    2727            <i></i>
    2828            <span><?php echo $key[0]; ?></span>
    29             <strong><?php echo $val; ?></strong>(<?php printf('%u/%u', @$tmp[$key]['on'], @$tmp[$key]['total']); ?>)</a>
     29            <strong><?php echo $val; ?></strong><?php
     30            if (isset($tmp[$key]))
     31            {
     32                printf('(%u/%u)', $tmp[$key]['on'], $tmp[$key]['total']);
     33            }
     34            ?></a>
    3035        <?php
    3136    }
  • http-headers/trunk/views/feature-policy.php

    r2233507 r2852524  
    8787                        foreach ($origins as $origin)
    8888                        {
    89                             ?><option value="<?php echo $origin; ?>"<?php selected(@$feature_policy_value[$feature], $origin); ?>><?php echo $origin; ?></option><?php
     89                            ?><option value="<?php echo $origin; ?>"<?php isset($feature_policy_value[$feature]) ? selected($feature_policy_value[$feature], $origin) : NULL; ?>><?php echo $origin; ?></option><?php
    9090                        }
    9191                        ?>
    9292                        </select>
    9393                        <input type="text" name="hh_feature_policy_origin[<?php echo $feature; ?>]"
    94                             value="<?php echo @$feature_policy_origin[$feature]; ?>" size="30"<?php echo isset($feature_policy_value[$feature]) && in_array($feature_policy_value[$feature], array('origin(s)', "'self'")) ? NULL : ' style="display: none"'; ?>
     94                               value="<?php echo isset($feature_policy_origin[$feature]) ? $feature_policy_origin[$feature] : NULL; ?>"
     95                               size="30"<?php echo isset($feature_policy_value[$feature]) && in_array($feature_policy_value[$feature], array('origin(s)', "'self'")) ? NULL : ' style="display: none"'; ?>
    9596                            class="http-header-value"<?php echo $feature_policy == 1 ? NULL : ' readonly'; ?>>
    9697                    </td>
  • http-headers/trunk/views/index.php

    r2520684 r2852524  
    3939    ?>
    4040    <p><?php _e('Quick links', 'http-headers'); ?>:
    41         <a href="https://zinoui.com/blog/http-headers-for-wordpress" target="_blank" title="HTTP Headers"><?php _e('Getting started', 'http-headers'); ?></a>,
    4241        <a href="<?php echo get_admin_url(); ?>options-general.php?page=http-headers&amp;tab=advanced"><?php _e('Advanced settings', 'http-headers'); ?></a>,
    4342        <a href="<?php echo get_admin_url(); ?>options-general.php?page=http-headers&amp;tab=manual"><?php _e('Manual setup', 'http-headers'); ?></a>,
  • http-headers/trunk/views/permissions-policy.php

    r2523948 r2852524  
    9797                        foreach ($origins as $origin)
    9898                        {
    99                             ?><option value="<?php echo $origin; ?>"<?php selected(@$permissions_policy_value[$feature], $origin); ?>><?php echo $origin; ?></option><?php
     99                            ?><option value="<?php echo $origin; ?>"<?php isset($permissions_policy_value[$feature]) ? selected($permissions_policy_value[$feature], $origin) : NULL; ?>><?php echo $origin; ?></option><?php
    100100                        }
    101101                        ?>
    102102                        </select>
    103103                        <input type="text" name="hh_permissions_policy_origin[<?php echo $feature; ?>]"
    104                             value="<?php echo htmlspecialchars( @$permissions_policy_origin[$feature] ); ?>" size="30"<?php echo isset($permissions_policy_value[$feature]) && in_array($permissions_policy_value[$feature], array('origin(s)', 'self')) ? NULL : ' style="display: none"'; ?>
     104                            value="<?php echo isset($permissions_policy_origin[$feature]) ? htmlspecialchars( $permissions_policy_origin[$feature] ) : NULL; ?>" size="30"<?php echo isset($permissions_policy_value[$feature]) && in_array($permissions_policy_value[$feature], array('origin(s)', 'self')) ? NULL : ' style="display: none"'; ?>
    105105                            class="http-header-value"<?php echo $permissions_policy == 1 ? NULL : ' readonly'; ?>>
    106106                    </td>
  • http-headers/trunk/views/report-to.php

    r2345633 r2852524  
    9595                                    ?>
    9696                                    </select></td>
    97                                     <td rowspan="<?php echo $cnt; ?>" class="hh-middle hh-center"><input type="checkbox" class="http-header-value" name="hh_report_to_value[<?php echo $i; ?>][include_subdomains]" value="1"<?php checked(@$item['include_subdomains'], 1, true); ?><?php echo $report_to == 1 ? NULL : ' readonly'; ?> /></td>
     97                                    <td rowspan="<?php echo $cnt; ?>" class="hh-middle hh-center"><input type="checkbox" class="http-header-value" name="hh_report_to_value[<?php echo $i; ?>][include_subdomains]" value="1"<?php array_key_exists('include_subdomains', $item) ? checked($item['include_subdomains'], 1, true) : NULL; ?><?php echo $report_to == 1 ? NULL : ' readonly'; ?> /></td>
    9898                                    <?php
    9999                                }
     
    146146                            ?>
    147147                            </select></td>
    148                             <td class="hh-center"><input type="checkbox" class="http-header-value" name="hh_report_to_value[<?php echo $i; ?>][include_subdomains]" value="1"<?php checked(@$item['include_subdomains'], 1, true); ?><?php echo $report_to == 1 ? NULL : ' readonly'; ?> /></td>
     148                            <td class="hh-center"><input type="checkbox" class="http-header-value" name="hh_report_to_value[<?php echo $i; ?>][include_subdomains]" value="1"<?php array_key_exists('include_subdomains', $item) ? checked($item['include_subdomains'], 1, true) : NULL; ?><?php echo $report_to == 1 ? NULL : ' readonly'; ?> /></td>
    149149                           
    150150                            <td><input type="text" class="http-header-value" name="hh_report_to_value[<?php echo $i; ?>][endpoints][0][url]" placeholder="https://example.com/report/csp"<?php echo $report_to == 1 ? NULL : ' readonly'; ?> size="40"></td>
Note: See TracChangeset for help on using the changeset viewer.