1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2024-11-29 11:24:11 +01:00

Merge pull request #973 from RealRancor/fix_undefined_index

Fix "Undefined index: REQUEST_URI" on cron runs
This commit is contained in:
Thomas Müller 2015-07-08 11:13:28 +02:00
commit d1fc2e0baa

View File

@ -32,10 +32,13 @@ namespace OCA\Contacts;
\OCP\Util::connectHook('OC_Calendar', 'getEvents', 'OCA\Contacts\Hooks', 'getBirthdayEvents'); \OCP\Util::connectHook('OC_Calendar', 'getEvents', 'OCA\Contacts\Hooks', 'getBirthdayEvents');
\OCP\Util::connectHook('OC_Calendar', 'getSources', 'OCA\Contacts\Hooks', 'getCalenderSources'); \OCP\Util::connectHook('OC_Calendar', 'getSources', 'OCA\Contacts\Hooks', 'getCalenderSources');
$url = \OC::$server->getRequest()->server['REQUEST_URI']; $request = \OC::$server->getRequest();
if (isset($request->server['REQUEST_URI'])) {
$url = $request->server['REQUEST_URI'];
if (preg_match('%index.php/apps/files(/.*)?%', $url)) { if (preg_match('%index.php/apps/files(/.*)?%', $url)) {
\OCP\Util::addscript('contacts', 'loader'); \OCP\Util::addscript('contacts', 'loader');
}
} }
\OC::$server->getSearch()->registerProvider('OCA\Contacts\Search\Provider', array('apps' => array('contacts'))); \OC::$server->getSearch()->registerProvider('OCA\Contacts\Search\Provider', array('apps' => array('contacts')));