Commit 14134c21 authored by yPhil's avatar yPhil
Browse files

Sanitized search prefix input

parent 15d41a02
Pipeline #395828 passed with stage
in 54 seconds
......@@ -732,9 +732,9 @@ fieldset.feedsMenuForm {
background-color: var(--color-ui-qua) !important;
}
/* .ui-button:not(.ui-spinner-button, .feedGuessButton, .feedErrorReportButton) { */
/* margin-right: 0.4em; */
/* } */
.ui-button:not(.ui-spinner-button, .feedGuessButton, .feedErrorReportButton) {
margin-right: 0.4em;
}
.rs-button {
margin-right: 0;
......
......@@ -139,6 +139,9 @@ PTL.i18n.translations = {
"Restore default search prefix" : { fr: "Rétablir le préfixe de recherche par défaut" , ja: "デフォルトの検索プレフィックスを復元", es: "Restaurar el prefijo de búsqueda predeterminado" },
"Restored search prefix to default value" : { fr: "Préfixe de recherche restauré à la valeur par défaut" , ja: "復元された検索プレフィックスをデフォルト値に復元しました", es: "Prefijo de búsqueda restaurado al valor predeterminado" },
"English" : { fr: "English" , ja: "English", es: "English" },
"Français" : { fr: "Français" , ja: "Français", es: "Français" },
"日本語" : { fr: "日本語" , ja: "日本語", es: "日本語" },
......
......@@ -32,11 +32,13 @@ var PTL = (function() {
$searchPrefixRestoreButton.click(function(){
console.log('val %s', $searchPrefixInput.val());
$searchPrefixInput.val(PTL.prefs.readConfig('searchPrefixDefault'));
PTL.util.say(PTL.tr('Restored search prefix to default value'), 'success', true);
});
$searchPrefixOkButton.click(function(){
PTL.prefs.writeConfig('searchPrefix', $searchPrefixInput.val());
console.log('val %s', $searchPrefixInput.val());
const clean = DOMPurify.sanitize($searchPrefixInput.val());
PTL.prefs.writeConfig('searchPrefix', clean);
PTL.util.say(PTL.tr('Search prefix') + ': ' + clean, 'success', true);
});
$('noscript').hide();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment