[Pkg-owncloud-commits] [owncloud] 62/75: Added some error checking as mentioned in http://bugs.owncloud.org/thebuggenie/owncloud/issues/oc-227
David Prévot
taffit at alioth.debian.org
Fri Nov 8 23:08:42 UTC 2013
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag v3.0.1
in repository owncloud.
commit 2ac20337fa170ce8c8cf4674494bd39d1699f804
Author: Thomas Tanghus <thomas at tanghus.net>
Date: Tue Feb 14 02:15:21 2012 +0100
Added some error checking as mentioned in http://bugs.owncloud.org/thebuggenie/owncloud/issues/oc-227
---
apps/contacts/lib/vcard.php | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/apps/contacts/lib/vcard.php b/apps/contacts/lib/vcard.php
index 619c124..b174ed4 100644
--- a/apps/contacts/lib/vcard.php
+++ b/apps/contacts/lib/vcard.php
@@ -47,6 +47,7 @@ class OC_Contacts_VCard{
* ['carddata']
*/
public static function all($id){
+ $result = null;
if(is_array($id)) {
$id_sql = join(',', array_fill(0, count($id), '?'));
$prep = 'SELECT * FROM *PREFIX*contacts_cards WHERE addressbookid IN ('.$id_sql.') ORDER BY fullname';
@@ -58,13 +59,20 @@ class OC_Contacts_VCard{
OC_Log::write('contacts','OC_Contacts_VCard:all, ids: '.join(',', $id),OC_Log::DEBUG);
OC_Log::write('contacts','SQL:'.$prep,OC_Log::DEBUG);
}
- } else {
- $stmt = OC_DB::prepare( 'SELECT * FROM *PREFIX*contacts_cards WHERE addressbookid = ? ORDER BY fullname' );
- $result = $stmt->execute(array($id));
+ } elseif($id) {
+ try {
+ $stmt = OC_DB::prepare( 'SELECT * FROM *PREFIX*contacts_cards WHERE addressbookid = ? ORDER BY fullname' );
+ $result = $stmt->execute(array($id));
+ } catch(Exception $e) {
+ OC_Log::write('contacts','OC_Contacts_VCard:all:, exception: '.$e->getMessage(),OC_Log::DEBUG);
+ OC_Log::write('contacts','OC_Contacts_VCard:all, ids: '. $id,OC_Log::DEBUG);
+ }
}
$cards = array();
- while( $row = $result->fetchRow()){
- $cards[] = $row;
+ if(!is_null($result)) {
+ while( $row = $result->fetchRow()){
+ $cards[] = $row;
+ }
}
return $cards;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list