Plugin Directory

Changeset 722711


Ignore:
Timestamp:
06/04/2013 06:34:43 PM (13 years ago)
Author:
macbrink
Message:

fix issue when non-80 port is used

Location:
eazyest-gallery
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • eazyest-gallery/branches/0.1/eazyest-gallery.php

    r722694 r722711  
    393393    $this->root = str_replace( '\\', '/', trailingslashit( $this->get_absolute_path( ABSPATH . $gallery_folder ) ) );
    394394   
    395     $http = empty( $_SERVER['HTTPS'] ) || 'off' == $_SERVER['HTTPS'] ? 'http://' : 'https://';
    396     $this->address = trailingslashit( $this->_resolve_href( trailingslashit( $http . $_SERVER['HTTP_HOST'] ), substr( $this->root, strlen( $this->home_dir() ) ) ) );
     395    $http = empty( $_SERVER['HTTPS'] ) || 'off' == $_SERVER['HTTPS'] ? 'http://' : 'https://'; 
     396    $port = ( $_SERVER["SERVER_PORT"] == '80' ) ? '' : ( ':' . $_SERVER['SERVER_PORT'] );
     397   
     398    $this->address = trailingslashit( $this->_resolve_href( trailingslashit( $http . $_SERVER['HTTP_HOST'] . $port ), substr( $this->root, strlen( $this->home_dir() ) ) ) );
    397399    }
    398400   
  • eazyest-gallery/trunk/eazyest-gallery.php

    r722694 r722711  
    2424 *
    2525 * @uses TableDnD plug-in for JQuery,
    26  * @copyright (c) Denis Howlett
     26 * @copyright (c) Denis Howlett396
    2727 *
    2828 * @uses JQuery File Tree,
     
    393393    $this->root = str_replace( '\\', '/', trailingslashit( $this->get_absolute_path( ABSPATH . $gallery_folder ) ) );
    394394   
    395     $http = empty( $_SERVER['HTTPS'] ) || 'off' == $_SERVER['HTTPS'] ? 'http://' : 'https://';
    396     $this->address = trailingslashit( $this->_resolve_href( trailingslashit( $http . $_SERVER['HTTP_HOST'] ), substr( $this->root, strlen( $this->home_dir() ) ) ) );
     395    $http = empty( $_SERVER['HTTPS'] ) || 'off' == $_SERVER['HTTPS'] ? 'http://' : 'https://';     
     396    $port = ( $_SERVER["SERVER_PORT"] == '80' ) ? '' : ( ':' . $_SERVER['SERVER_PORT'] );
     397   
     398    $this->address = trailingslashit( $this->_resolve_href( trailingslashit( $http . $_SERVER['HTTP_HOST'] . $port ), substr( $this->root, strlen( $this->home_dir() ) ) ) );
    397399    }
    398400   
Note: See TracChangeset for help on using the changeset viewer.