Skip to content

Commit

Permalink
Merge branch 'MDL-39444_23' of git://github.com/timhunt/moodle into M…
Browse files Browse the repository at this point in the history
…OODLE_23_STABLE
  • Loading branch information
stronk7 committed May 1, 2013
2 parents 48c8137 + 6137bc9 commit c738cc9
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions lib/moodlelib.php
Expand Up @@ -6603,10 +6603,6 @@ public function load_component_strings($component, $lang, $disablecache=false, $
* @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]);
Expand Down Expand Up @@ -7063,10 +7059,6 @@ public function load_component_strings($component, $lang, $disablecache=false, $
* @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);
Expand Down Expand Up @@ -7312,8 +7304,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.');
}

Expand Down Expand Up @@ -11120,7 +11111,7 @@ protected function get_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');
}

Expand Down

0 comments on commit c738cc9

Please sign in to comment.