From 73064df8f71ed7b5e1cbf43eaaf70aa6d52877ca Mon Sep 17 00:00:00 2001 From: tjhunt Date: Thu, 30 Oct 2008 03:56:48 +0000 Subject: [PATCH] user selection: Make inserting the search term into lang strings in JavaScript more robust. --- user/selector/lib.php | 4 ++-- user/selector/script.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/user/selector/lib.php b/user/selector/lib.php index e1cdfbb635..84a43b7f55 100644 --- a/user/selector/lib.php +++ b/user/selector/lib.php @@ -471,8 +471,8 @@ abstract class user_selector_base { // Initialise the selector. $output .= print_js_call('new user_selector', array($this->name, $hash, - sesskey(), $this->extrafields, get_string('previouslyselectedusers'), - get_string('nomatchingusers')), true); + sesskey(), $this->extrafields, get_string('previouslyselectedusers', '', '%%SEARCHTERM%%'), + get_string('nomatchingusers', '', '%%SEARCHTERM%%')), true); return $output; } } diff --git a/user/selector/script.js b/user/selector/script.js index 6850c8f745..07e33b93b8 100644 --- a/user/selector/script.js +++ b/user/selector/script.js @@ -283,7 +283,7 @@ user_selector.prototype.handle_selection_change = function() { // Methods for refreshing the list of displayed options ======================== user_selector.prototype.insert_search_into_str = function(string, search) { - return string.replace("''", "'" + search + "'"); + return string.replace("%%SEARCHTERM%%", search); } /** -- 2.39.5