Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bad pathing creating double-slashes. #1843

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
= [TBD] TBD =

* Fix - Ensure the `clear country` icon resets the value as expect in the create/edit venue page. [TEC-4393]
* Fix - Correct and issue where template paths would contain double-slashes `\\` due to empty entries in the paths array. [ECP-1400]

= [5.0.4] 2022-11-29 =

Expand Down
8 changes: 4 additions & 4 deletions src/Tribe/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ protected function get_template_plugin_path() {
$path = array_merge( (array) $this->template_base_path, $this->folder );

// Implode to avoid Window Problems
$path = implode( DIRECTORY_SEPARATOR, $path );
$path = implode( DIRECTORY_SEPARATOR, array_filter( $path ) );

/**
* Allows filtering of the base path for templates
Expand Down Expand Up @@ -505,7 +505,7 @@ protected function get_template_public_path( $base, $namespace ) {
}

// Implode to avoid Window Problems
$path = implode( DIRECTORY_SEPARATOR, $path );
$path = implode( DIRECTORY_SEPARATOR, array_filter( $path ) );

/**
* Allows filtering of the base path for templates
Expand Down Expand Up @@ -649,7 +649,7 @@ public function get_template_file( $name ) {
}

// Build the File Path
$file = implode( DIRECTORY_SEPARATOR, array_merge( (array) $folder['path'], $name ) );
$file = implode( DIRECTORY_SEPARATOR, array_filter( array_merge( (array) $folder['path'], $name ) ) );

// Append the Extension to the file path
$file .= '.php';
Expand Down Expand Up @@ -1149,7 +1149,7 @@ protected function get_template_common_path() {
$path = array_merge( (array) $common_abs_path, $this->folder );

// Implode to avoid problems on Windows hosts.
$path = implode( DIRECTORY_SEPARATOR, $path );
$path = implode( DIRECTORY_SEPARATOR, array_filter( $path ) );

/**
* Allows filtering the path to a template provided by Common.
Expand Down