1
0
mirror of https://github.com/nextcloud/ocsms.git synced 2026-08-11 16:32:55 +00:00

v1.6.2: Fix owncloud 9 contact app which break our frontend

This commit is contained in:
Loic Blot
2016-03-08 22:51:00 +01:00
parent 2990a5cbad
commit 3d71229767
4 changed files with 28 additions and 4 deletions
+10 -1
View File
@@ -12,6 +12,8 @@
namespace OCA\OcSms\Lib;
use \OCP\Util;
class ContactCache {
/**
* @var array used to cache the parsed contacts for every request
@@ -89,8 +91,15 @@ class ContactCache {
if (isset ($r["PHOTO"])) {
// Remove useless prefix
// @TODO detect owncloud version
$ocversion = \OCP\Util::getVersion();
$photoURL = preg_replace("#^VALUE=uri:#","",$r["PHOTO"], 1);
$this->contactPhotos[$r["FN"]] = $photoURL;
if (version_compare($ocversion[0].".".$ocversion[1].".".$ocversion[2], "9.0.0", ">=")) {
$this->contactPhotos[$r["FN"]] = base64_encode($photoURL);
}
else {
$this->contactPhotos[$r["FN"]] = $photoURL;
}
}
}
}