[Jifty-commit] r2550 - in jifty/trunk: lib/Jifty/Plugin/REST
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Wed Jan 24 17:48:48 EST 2007
Author: trs
Date: Wed Jan 24 17:48:45 2007
New Revision: 2550
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Plugin/REST/Dispatcher.pm
Log:
r19045 at zot: tom | 2007-01-24 17:48:29 -0500
* Only allow method calls if the "field" is actually a column
* Force stringification so that we don't segfault trying to output blessed references and what not
Modified: jifty/trunk/lib/Jifty/Plugin/REST/Dispatcher.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/REST/Dispatcher.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/REST/Dispatcher.pm Wed Jan 24 17:48:45 2007
@@ -331,7 +331,13 @@
$rec->load_by_cols( $column => $key );
$rec->id or abort(404);
$rec->can($field) or abort(404);
- outs( [ 'model', $model, $column, $key, $field ], $rec->$field());
+
+ abort(404) if not scalar grep { $_->name eq $field } $rec->columns;
+
+ # Force stringification
+ my $value = "@{[$rec->$field()]}";
+
+ outs( [ 'model', $model, $column, $key, $field ], $value );
}
=head2 show_item $model, $column, $key
More information about the Jifty-commit
mailing list