Author: danieleocchipinti
Date: 2010-03-23 14:49:43 +0100 (Tue, 23 Mar 2010)
New Revision: 28705
Modified:
plugins/sfErrorNotifierPlugin/trunk/lib/sfErrorNotifierMail.php
Log:
made the code a bit more robust
Modified: plugins/sfErrorNotifierPlugin/trunk/lib/sfErrorNotifierMail.php
===================================================================
--- plugins/sfErrorNotifierPlugin/trunk/lib/sfErrorNotifierMail.php
2010-03-23 13:46:04 UTC (rev 28704)
+++ plugins/sfErrorNotifierPlugin/trunk/lib/sfErrorNotifierMail.php
2010-03-23 13:49:43 UTC (rev 28705)
@@ -125,13 +125,19 @@
$this->beginTable();
$user = $this->context->getUser();
$subtable = array();
- foreach ($user->getAttributeHolder()->getAll() as $key => $value){
- if (is_array($value))
+
+ if (is_object($user))
{
- $value = 'Array: ' . implode(', ', $value);
+ foreach ($user->getAttributeHolder()->getAll() as $key =>
$value)
+ {
+ if (is_array($value))
+ {
+ $value = 'Array: ' . implode(', ', $value);
+ }
+ $subtable[] = '<b>'.$key.'</b>: '.$value;
+ }
}
- $subtable[] = '<b>'.$key.'</b>: '.$value;
- }
+
$subtable = implode('<br/>',$subtable);
$this->addRow('Attributes',$subtable);
--
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.