Author: xavier
Date: 2010-04-23 15:09:13 +0200 (Fri, 23 Apr 2010)
New Revision: 29248
Modified:
plugins/sfDoctrineRestGeneratorPlugin/trunk/lib/sfRestInflector.class.php
Log:
[wiki:sfDoctrineRestGeneratorPlugin]: fixed bug in escaping for false or 0
values
Modified:
plugins/sfDoctrineRestGeneratorPlugin/trunk/lib/sfRestInflector.class.php
===================================================================
--- plugins/sfDoctrineRestGeneratorPlugin/trunk/lib/sfRestInflector.class.php
2010-04-23 12:15:00 UTC (rev 29247)
+++ plugins/sfDoctrineRestGeneratorPlugin/trunk/lib/sfRestInflector.class.php
2010-04-23 13:09:13 UTC (rev 29248)
@@ -35,15 +35,17 @@
}
else
{
- if ('' != trim($value))
+ $trimed_value = ($value !== false) ? trim($value) : '0';
+
+ if ($trimed_value !== '')
{
- if (htmlspecialchars($value)!=$value)
+ if (htmlspecialchars($trimed_value) != $trimed_value)
{
- $xml .= '<'.$key.'><![CDATA['.$value.']]></'.$key.'>';
+ $xml .= '<'.$key.'><![CDATA['.$trimed_value.']]></'.$key.'>';
}
else
{
- $xml .= '<'.$key.'>'.$value.'</'.$key.'>';
+ $xml .= '<'.$key.'>'.$trimed_value.'</'.$key.'>';
}
}
}
--
You received this message because you are subscribed to the Google Groups
"symfony SVN" 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.com/group/symfony-svn?hl=en.