From a0e27dbf574dcc1e237094462a15edcbb781557a Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Wed, 2 Jul 2008 07:22:10 +0000
Subject: [PATCH] Add warning for deprecated use of addURLparameter.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@743 44740490-163a-0410-bde0-09ae8108e29a
---
 lib/SimpleSAML/Utilities.php | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lib/SimpleSAML/Utilities.php b/lib/SimpleSAML/Utilities.php
index 01e773bb7..54ed4c201 100644
--- a/lib/SimpleSAML/Utilities.php
+++ b/lib/SimpleSAML/Utilities.php
@@ -142,13 +142,21 @@ class SimpleSAML_Utilities {
 	 * @param $url  The URL the query parameters should be added to.
 	 * @param $parameter  The query parameters which should be added to the url. This should be
 	 *                    an associative array. For backwards comaptibility, it can also be a
-	 *                    query string representing the new parameters.
+	 *                    query string representing the new parameters. This will write a warning
+	 *                    to the log.
 	 * @return The URL with the new query parameters.
 	 */
 	public static function addURLparameter($url, $parameter) {
 
 		/* For backwards compatibility - allow $parameter to be a string. */
 		if(is_string($parameter)) {
+			/* Print warning to log. */
+			$backtrace = debug_backtrace();
+			$where = $backtrace[0]['file'] . ':' . $backtrace[0]['line'];
+			SimpleSAML_Logger::warning(
+				'Deprecated use of SimpleSAML_Utilities::addURLparameter at ' .	$where .
+				'. The parameter "$parameter" should now be an array, but a string was passed.');
+
 			$parameter = self::parseQueryString($parameter);
 		}
 		assert('is_array($parameter)');
-- 
GitLab