From 9397b7dbcd90786f4fa6369dab98e3ace06808a3 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Sun, 5 Feb 2012 09:42:32 -0800 Subject: [PATCH] Force casting of user_no to integer. --- inc/caldav-MKCOL.php | 2 +- inc/caldav-PROPPATCH.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/caldav-MKCOL.php b/inc/caldav-MKCOL.php index 3ae1dc48..805ed660 100644 --- a/inc/caldav-MKCOL.php +++ b/inc/caldav-MKCOL.php @@ -206,7 +206,7 @@ if ( ! $qry->QDo( 'INSERT INTO collection ( user_no, parent_container, dav_name, $request->DoResponse( 500, translate('Error writing calendar details to database.') ); } foreach( $dav_properties AS $k => $v ) { - if ( ! $qry->QDo('SELECT set_dav_property( :dav_name, :user_no, :tag::text, :value::text )', + if ( ! $qry->QDo('SELECT set_dav_property( :dav_name, :user_no::integer, :tag::text, :value::text )', array( ':dav_name' => $request->path, ':user_no' => $request->user_no, ':tag' => $k, ':value' => $v) ) ) { $request->DoResponse( 500, translate('Error writing calendar properties to database.') ); } diff --git a/inc/caldav-PROPPATCH.php b/inc/caldav-PROPPATCH.php index 4e1163cd..df8b95d0 100644 --- a/inc/caldav-PROPPATCH.php +++ b/inc/caldav-PROPPATCH.php @@ -210,7 +210,7 @@ foreach( $setprops AS $k => $setting ) { * If we don't have any special processing for the property, we just store it verbatim (which will be an XML fragment). */ default: - $qry->QDo('SELECT set_dav_property( :dav_name, :user_no, :tag::text, :value::text)', + $qry->QDo('SELECT set_dav_property( :dav_name, :user_no::integer, :tag::text, :value::text)', array( ':dav_name' => $dav_resource->dav_name(), ':user_no' => $request->user_no, ':tag' => $tag, ':value' => $content) ); $success[$tag] = 1; break; -- 2.11.4.GIT