From b97d243978c1110a9a0b589021fc182674bdf3f5 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 24 Mar 2024 09:58:50 +0400 Subject: [PATCH] Fix jump to hash with accents in IV. --- Telegram/Resources/iv_html/page.js | 2 +- Telegram/SourceFiles/iv/iv_controller.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Telegram/Resources/iv_html/page.js b/Telegram/Resources/iv_html/page.js index 26cab565c..0139f4c91 100644 --- a/Telegram/Resources/iv_html/page.js +++ b/Telegram/Resources/iv_html/page.js @@ -42,7 +42,7 @@ var IV = { } else if (target.hash.length < 2) { IV.jumpToHash(''); } else { - IV.jumpToHash(target.hash.substr(1)); + IV.jumpToHash(decodeURIComponent(target.hash.substr(1))); } e.preventDefault(); }, diff --git a/Telegram/SourceFiles/iv/iv_controller.cpp b/Telegram/SourceFiles/iv/iv_controller.cpp index fcbab153a..c62debebf 100644 --- a/Telegram/SourceFiles/iv/iv_controller.cpp +++ b/Telegram/SourceFiles/iv/iv_controller.cpp @@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/platform/base_platform_info.h" #include "base/invoke_queued.h" #include "base/qt_signal_producer.h" +#include "base/qthelp_url.h" #include "iv/iv_data.h" #include "lang/lang_keys.h" #include "ui/platform/ui_platform_window_title.h" @@ -615,7 +616,7 @@ QByteArray Controller::navigateScript(int index, const QString &hash) { return "IV.navigateTo(" + QByteArray::number(index) + ", '" - + EscapeForScriptString(hash.toUtf8()) + + EscapeForScriptString(qthelp::url_decode(hash).toUtf8()) + "');"; }