Index: openacs-4/packages/acs-lang/www/change-locale.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/www/change-locale.tcl,v diff -u -r1.5 -r1.5.2.1 --- openacs-4/packages/acs-lang/www/change-locale.tcl 5 Jan 2018 22:59:57 -0000 1.5 +++ openacs-4/packages/acs-lang/www/change-locale.tcl 1 Oct 2019 11:49:25 -0000 1.5.2.1 @@ -3,8 +3,15 @@ } { user_locale return_url:localurl +} -validate { + valid_user_locale -requires user_locale { + if {![::xo::dc 0or1row user_locale_exists {select 1 from ad_locales where locale = :user_locale}] } { + ad_complain "invalid user_locale" + } + } } + if { [catch {lang::user::set_locale $user_locale} errmsg] } { ns_log Error "acs-lang/www/change-locale crashed calling lang::user::set_locale with user_locale='$user_locale'\n$errmsg" ad_return_error [_ acs-lang.Error_changing_locale] [_ acs-lang.User_locale_not_set]