diff options
| author | 2026-01-21 03:00:39 +0800 | |
|---|---|---|
| committer | 2026-01-20 20:00:39 +0100 | |
| commit | 84604e0c641f2ede1e9f1becb70968400f7b4fb5 (patch) | |
| tree | 55d057423278a3917eaa37f2bc2e19b503ad9ced /p | |
| parent | 63379a6fc2fdf160e00595f7be66742138ba6ce1 (diff) | |
fix validator url update (#8436)
Closes https://github.com/FreshRSS/FreshRSS/issues/8435
Changes proposed in this pull request:
- update validator links to use the same open-url handler with prefix + encoding
- ensure the validator link reflects the current #url field value before opening
- keep existing open-url behavior for other links unchanged
How to test the feature manually:
1. Open feed edit (or add feed) form.
2. Change the feed URL in the URL field.
3. Click “Check the validity of the feed” and verify it opens the validator with the updated URL.
Diffstat (limited to 'p')
| -rw-r--r-- | p/scripts/extra.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/p/scripts/extra.js b/p/scripts/extra.js index 6f896f959..43bbd89f5 100644 --- a/p/scripts/extra.js +++ b/p/scripts/extra.js @@ -395,11 +395,14 @@ function close_slider_listener(ev) { } // </slider> -// overwrites the href attribute from the url input +// updates href from the input value, with optional prefix/encoding function updateHref(ev) { const urlField = document.getElementById(this.getAttribute('data-input')); - const url = urlField.value; - if (url.length > 0) { + const rawUrl = urlField.value; + const prefix = this.getAttribute('data-prefix') || ''; + const shouldEncode = this.getAttribute('data-encode') === '1'; + const url = prefix + (shouldEncode ? encodeURIComponent(rawUrl) : rawUrl); + if (rawUrl.length > 0) { this.href = url; return true; } else { |
