mirror of
https://github.com/moodle/moodle.git
synced 2025-05-15 12:45:41 +02:00
Merge branch 'MDL-39444' of git://github.com/timhunt/moodle
This commit is contained in:
commit
2f679b426a
@ -6831,10 +6831,6 @@ class core_string_manager implements string_manager {
|
||||
* @return boot true if exists
|
||||
*/
|
||||
public function string_exists($identifier, $component) {
|
||||
$identifier = clean_param($identifier, PARAM_STRINGID);
|
||||
if (empty($identifier)) {
|
||||
return false;
|
||||
}
|
||||
$lang = current_language();
|
||||
$string = $this->load_component_strings($component, $lang);
|
||||
return isset($string[$identifier]);
|
||||
@ -7312,10 +7308,6 @@ class install_string_manager implements string_manager {
|
||||
* @return boot true if exists
|
||||
*/
|
||||
public function string_exists($identifier, $component) {
|
||||
$identifier = clean_param($identifier, PARAM_STRINGID);
|
||||
if (empty($identifier)) {
|
||||
return false;
|
||||
}
|
||||
// simple old style hack ;)
|
||||
$str = get_string($identifier, $component);
|
||||
return (strpos($str, '[[') === false);
|
||||
@ -7573,8 +7565,7 @@ function get_string($identifier, $component = '', $a = NULL, $lazyload = false)
|
||||
return new lang_string($identifier, $component, $a);
|
||||
}
|
||||
|
||||
$identifier = clean_param($identifier, PARAM_STRINGID);
|
||||
if (empty($identifier)) {
|
||||
if (debugging('', DEBUG_DEVELOPER) && clean_param($identifier, PARAM_STRINGID) === '') {
|
||||
throw new coding_exception('Invalid string identifier. The identifier cannot be empty. Please fix your get_string() call.');
|
||||
}
|
||||
|
||||
@ -11424,7 +11415,7 @@ class lang_string {
|
||||
// Check if we need to process the string
|
||||
if ($this->string === null) {
|
||||
// Check the quality of the identifier.
|
||||
if (clean_param($this->identifier, PARAM_STRINGID) == '') {
|
||||
if (debugging('', DEBUG_DEVELOPER) && clean_param($this->identifier, PARAM_STRINGID) === '') {
|
||||
throw new coding_exception('Invalid string identifier. Most probably some illegal character is part of the string identifier. Please check your string definition');
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user