Author: david
Date: Tue Sep 15 10:05:11 2009
New Revision: 3302
Log:
Test that $this->params exists before calling foreach() to avoid warnings.
Modified:
trunk/lib/vendor/symfony/lib/routing/sfRoute.class.php
Modified: trunk/lib/vendor/symfony/lib/routing/sfRoute.class.php
==============================================================================
--- trunk/lib/vendor/symfony/lib/routing/sfRoute.class.php Tue Sep 15
09:32:26 2009 (r3301)
+++ trunk/lib/vendor/symfony/lib/routing/sfRoute.class.php Tue Sep 15
10:05:11 2009 (r3302)
@@ -180,11 +180,14 @@
}
// check that $params does not override a default value that is not a
variable
- foreach ($this->params as $key => $value)
+ if (isset($this->params))
{
- if (!isset($this->variables[$key]) && $tparams[$key] != $value)
+ foreach ($this->params as $key => $value)
{
- return false;
+ if (!isset($this->variables[$key]) && $tparams[$key] != $value)
+ {
+ return false;
+ }
}
}
@@ -231,7 +234,7 @@
{
$url = str_replace($value, urlencode($tparams[$variable]), $url);
}
-
+
if(!in_array($this->suffix, $this->options['segment_separators']))
{
$url .= $this->suffix;
@@ -530,7 +533,7 @@
throw new InvalidArgumentException(sprintf('Unable to parse "%s" route
near "%s".', $this->pattern, $buffer));
}
}
-
+
// check for suffix
if ($this->suffix)
{
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---