Plugin Directory

Changeset 3183470


Ignore:
Timestamp:
11/07/2024 12:05:23 AM (13 months ago)
Author:
tmatsuur
Message:

[Update] login rebuilder:2.8.6 Adjusted what is applied to internally stored hostnames when SERVERSERVER_ADDR? does not exist.

Location:
login-rebuilder/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • login-rebuilder/trunk/login-rebuilder.php

    r3146283 r3183470  
    55Description: This plugin will create a new login page for your site. The new login page can be placed in any directory. You can also create separate login pages for administrators and for other users.
    66Author: tmatsuur
    7 Version: 2.8.5
     7Version: 2.8.6
    88Author URI: https://12net.jp/
    99Text Domain: login-rebuilder
     
    2020define( 'LOGIN_REBUILDER_DOMAIN', 'login-rebuilder' );
    2121define( 'LOGIN_REBUILDER_DB_VERSION_NAME', 'login-rebuilder-db-version' );
    22 define( 'LOGIN_REBUILDER_DB_VERSION', '2.8.3' );
     22define( 'LOGIN_REBUILDER_DB_VERSION', '2.8.6' );
    2323define( 'LOGIN_REBUILDER_PROPERTIES', 'login-rebuilder' );
    2424define( 'LOGIN_REBUILDER_LOGGING_NAME', 'login-rebuilder-logging' );
     
    117117        if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) {
    118118            $remote_addr = $_SERVER['HTTP_CLIENT_IP'];
    119         } else if ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
     119        } elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
    120120            $ip_array = explode( ',', $_SERVER['HTTP_X_FORWARDED_FOR'] );
    121121            $remote_addr = $ip_array[0];
    122122        } else {
    123             $remote_addr = $_SERVER['REMOTE_ADDR'];
     123            $remote_addr = isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : self::INVALID_REMOTE_ADDR;  // [2.8.6] $_SERVER['REMOTE_ADDR'] not exist.
    124124        }
    125125        $this->remote_addr = preg_match( '/^(([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3,5}([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/', $remote_addr )? $remote_addr: self::INVALID_REMOTE_ADDR;
     
    132132        } elseif ( isset( $_SERVER['SERVER_NAME'] ) ) {
    133133            $this->host_name = $_SERVER['SERVER_NAME'];
    134         } else {
     134        } elseif ( isset( $_SERVER['SERVER_ADDR'] ) ) { // [2.8.6] $_SERVER['SERVER_ADDR'] exists.
    135135            $this->host_name = gethostbyaddr( $_SERVER['SERVER_ADDR'] );
     136        } else { // [2.8.6] $_SERVER['SERVER_ADDR'] not exist.
     137            $this->host_name = parse_url( get_site_url(), PHP_URL_HOST );
    136138        }
    137139
  • login-rebuilder/trunk/readme.txt

    r3146283 r3183470  
    55Requires at least: 3.2.0
    66Requires PHP: 5.6
    7 Tested up to: 6.6.1
    8 Stable tag: 2.8.5
     7Tested up to: 6.7.0
     8Stable tag: 2.8.6
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    9595== Changelog ==
    9696
     97= 2.8.6 =
     98* Bug fix: Adjusted what is applied to internally stored hostnames when SERVER['SERVER_ADDR'] does not exist.
     99
    97100= 2.8.5 =
    98101* Bug fix: Adjusted what is applied to internally stored hostnames when SERVER['HTTP_HOST'] does not exist.
Note: See TracChangeset for help on using the changeset viewer.