Permalink
Browse files

Escape % signs in get_string() function optional parameter. Bug #3527

  • Loading branch information...
1 parent fc823bf commit ecc0c8b802050fdafaa6e40e2f9e57b34faf692b thepurpleblob committed Jun 20, 2005
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/moodlelib.php
View
@@ -4311,6 +4311,9 @@ function get_string($identifier, $module='', $a=NULL) {
$module = 'moodle';
}
+ // if $a happens to have % in it, double it so sprintf() doesn't break
+ $a = str_replace( '%','%%',$a );
+
/// Define the two or three major locations of language strings for this module
$locations = array( $CFG->dataroot.'/lang/', $CFG->dirroot.'/lang/' );

0 comments on commit ecc0c8b

Please sign in to comment.