diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:51:18 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:51:18 +0000 |
commit | 0e41b5d52fdc6af6442816b5f465c9db9f84e126 (patch) | |
tree | e139a90049b158d4eed892d1662ee7f5c358fa31 /wp-includes/js/dist/url.js | |
parent | Adding upstream version 6.5.5+dfsg1. (diff) | |
download | wordpress-upstream.tar.xz wordpress-upstream.zip |
Adding upstream version 6.6.1+dfsg1.upstream/6.6.1+dfsg1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wp-includes/js/dist/url.js')
-rw-r--r-- | wp-includes/js/dist/url.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/wp-includes/js/dist/url.js b/wp-includes/js/dist/url.js index 37f5a40..f87a714 100644 --- a/wp-includes/js/dist/url.js +++ b/wp-includes/js/dist/url.js @@ -891,8 +891,12 @@ function getPathAndQueryString(url) { const path = getPath(url); const queryString = getQueryString(url); let value = '/'; - if (path) value += path; - if (queryString) value += `?${queryString}`; + if (path) { + value += path; + } + if (queryString) { + value += `?${queryString}`; + } return value; } @@ -1326,6 +1330,9 @@ function cleanForSlug(string) { */ function getFilename(url) { let filename; + if (!url) { + return; + } try { filename = new URL(url, 'http://example.com').pathname.split('/').pop(); } catch (error) {} |