Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions admin/class-fastcgi-purger.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function purge_url( $url, $feed = true ) {
switch ( $nginx_helper_admin->options['purge_method'] ) {

case 'unlink_files':
$_url_purge_base = $parse['scheme'] . '://' . $parse['host'] . $parse['path'];
$_url_purge_base = ( $parse['scheme'] ?? 'https' ) . '://' . ( $parse['host'] ?? $_SERVER['HTTP_HOST'] ) . ( $parse['path'] ?? '/' );
$_url_purge = $_url_purge_base;

if ( ! empty( $parse['query'] ) ) {
Expand Down Expand Up @@ -143,7 +143,7 @@ public function custom_purge_urls() {
switch ( $nginx_helper_admin->options['purge_method'] ) {

case 'unlink_files':
$_url_purge_base = $parse['scheme'] . '://' . $parse['host'];
$_url_purge_base = ( $parse['scheme'] ?? 'https' ) . '://' . ( $parse['host'] ?? $_SERVER['HTTP_HOST'] );

if ( is_array( $purge_urls ) && ! empty( $purge_urls ) ) {

Expand Down Expand Up @@ -274,7 +274,7 @@ private function purge_base_url() {
// Prevent users from inserting a trailing '/' that could break the url purging.
$path = trim( $path, '/' );

$purge_url_base = $parse['scheme'] . '://' . $parse['host'] . '/' . $path;
$purge_url_base = ( $parse['scheme'] ?? 'https' ) . '://' . ( $parse['host'] ?? $_SERVER['HTTP_HOST'] ) . '/' . $path;

/**
* Filter to change purge URL base for FastCGI cache.
Expand Down