diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2012-02-17 19:04:12 +0100 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2012-02-18 11:49:31 +0100 |
commit | 868cf6bb836c136d2ad881bf99710404c74507c3 (patch) | |
tree | 815de0eecf9e1ae197dc6737be760f5ea668a08a /apps | |
parent | 96612c506e08ce6b2fb39425c73f0a8d81a4cad8 (diff) | |
download | nextcloud-server-868cf6bb836c136d2ad881bf99710404c74507c3.tar.gz nextcloud-server-868cf6bb836c136d2ad881bf99710404c74507c3.zip |
Avoid errors from missing GD library.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/contacts/photo.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/contacts/photo.php b/apps/contacts/photo.php index 8dfbcb6fb10..298f1215e3c 100644 --- a/apps/contacts/photo.php +++ b/apps/contacts/photo.php @@ -13,10 +13,19 @@ require_once('../../lib/base.php'); OC_Util::checkLoggedIn(); OC_Util::checkAppEnabled('contacts'); +function getStandardImage(){ + OC_Response::setExpiresHeader('P10D'); + OC_Response::enableCaching(); + OC_Response::redirect(OC_Helper::imagePath('contacts', 'person_large.png')); +} + $id = $_GET['id']; $contact = OC_Contacts_App::getContactVCard($id); $image = new OC_Image(); +if(!$image) { + getStandardImage(); +} // invalid vcard if( is_null($contact)) { OC_Log::write('contacts','photo.php. The VCard for ID '.$id.' is not RFC compatible',OC_Log::ERROR); @@ -45,7 +54,8 @@ if( is_null($contact)) { } if (!$image->valid()) { // Not found :-( - $image->loadFromFile('img/person_large.png'); + getStandardImage(); + //$image->loadFromFile('img/person_large.png'); } header('Content-Type: '.$image->mimeType()); $image->show(); |