From 7d183c2bc8a2f364e93e7f9911ae28752212868d Mon Sep 17 00:00:00 2001 From: "Stephen A. Bernhardt" Date: Mon, 2 Feb 2026 10:49:47 -0600 Subject: [PATCH] Create unit tests --- tests/phpunit/tests/formatting/escUrl.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/phpunit/tests/formatting/escUrl.php b/tests/phpunit/tests/formatting/escUrl.php index e994ecdebd30b..da4a4aaa33328 100644 --- a/tests/phpunit/tests/formatting/escUrl.php +++ b/tests/phpunit/tests/formatting/escUrl.php @@ -311,4 +311,13 @@ public function test_ipv6_hosts() { $this->assertSame( '//[::FFFF::127.0.0.1]/?foo%5Bbar%5D=baz', esc_url( '//[::FFFF::127.0.0.1]/?foo[bar]=baz' ) ); $this->assertSame( 'http://[::FFFF::127.0.0.1]/?foo%5Bbar%5D=baz', esc_url( 'http://[::FFFF::127.0.0.1]/?foo[bar]=baz' ) ); } + + /** + * @ticket 46791 + */ + public function test_directory_relative_references() { + $this->assertSame( './current-directory', esc_url( './current-directory' ) ); + $this->assertSame( '../parent-directory', esc_url( '../parent-directory' ) ); + $this->assertSame( '../../../../up-four-directories', esc_url( '../../../../up-four-directories' ) ); + } }