From 768ed01ae32f74565529fb0186fa8fcee07b8711 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no>
Date: Tue, 17 Feb 2009 09:30:41 +0000
Subject: [PATCH] Allow numeric replacements in template class

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1277 44740490-163a-0410-bde0-09ae8108e29a
---
 lib/SimpleSAML/XHTML/Template.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/SimpleSAML/XHTML/Template.php b/lib/SimpleSAML/XHTML/Template.php
index e56316fe8..8872869a6 100644
--- a/lib/SimpleSAML/XHTML/Template.php
+++ b/lib/SimpleSAML/XHTML/Template.php
@@ -328,7 +328,6 @@ class SimpleSAML_XHTML_Template {
 	 * @return string  The translated tag, or a placeholder value if the tag wasn't found.
 	 */
 	public function t($tag, $replacements = array(), $fallbackdefault = true, $oldreplacements = array(), $striptags = false) {
-
 		if(!is_array($replacements)) {
 
 			/* Old style call to t(...). Print warning to log. */
@@ -360,9 +359,10 @@ class SimpleSAML_XHTML_Template {
 
 		$translated = $this->getTranslation($tagData);
 
+#		if (!empty($replacements)){		echo('<pre> [' . $tag . ']'); print_r($replacements); exit; }
 		foreach ($replacements as $k => $v) {
 			/* try to translate if no replacement is given */
-			if (!$v) $v = $this->t($k);
+			if ($v == NULL) $v = $this->t($k);
 			$translated = str_replace($k, $v, $translated);
 		}
 		return $translated;
-- 
GitLab