From ecc0c8b802050fdafaa6e40e2f9e57b34faf692b Mon Sep 17 00:00:00 2001 From: thepurpleblob Date: Mon, 20 Jun 2005 09:08:48 +0000 Subject: [PATCH] Escape % signs in get_string() function optional parameter. Bug #3527 --- lib/moodlelib.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index b84db8c1ac6..97952904170 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -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/' );