diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-11-23 09:38:01 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-11-23 09:38:01 +0100 |
commit | 79bbda994bb8dd2231f68f57785237f79f86f6c7 (patch) | |
tree | 65585aed0d21cc679cdf7e2509efd6fa3d33b458 /lib/private | |
parent | 2f89eef334bd445a7e046d845d5d5d1b3e4b6b8c (diff) | |
parent | 418fefc93c3332c77ec617ef108138efb6a34544 (diff) | |
download | nextcloud-server-79bbda994bb8dd2231f68f57785237f79f86f6c7.tar.gz nextcloud-server-79bbda994bb8dd2231f68f57785237f79f86f6c7.zip |
Merge pull request #16902 from owncloud/jsocclient
Web UI uses Webdav instead of ajax/* calls
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/appframework/http/request.php | 5 | ||||
-rw-r--r-- | lib/private/template.php | 11 |
2 files changed, 13 insertions, 3 deletions
diff --git a/lib/private/appframework/http/request.php b/lib/private/appframework/http/request.php index 96620838dfb..ea42c9a8967 100644 --- a/lib/private/appframework/http/request.php +++ b/lib/private/appframework/http/request.php @@ -42,7 +42,7 @@ use OCP\Security\ISecureRandom; */ class Request implements \ArrayAccess, \Countable, IRequest { - const USER_AGENT_IE = '/MSIE/'; + const USER_AGENT_IE = '/(MSIE)|(Trident)/'; const USER_AGENT_IE_8 = '/MSIE 8.0/'; // Android Chrome user agent: https://developers.google.com/chrome/mobile/docs/user-agent const USER_AGENT_ANDROID_MOBILE_CHROME = '#Android.*Chrome/[.0-9]*#'; @@ -674,6 +674,9 @@ class Request implements \ArrayAccess, \Countable, IRequest { * @return bool true if at least one of the given agent matches, false otherwise */ public function isUserAgent(array $agent) { + if (!isset($this->server['HTTP_USER_AGENT'])) { + return false; + } foreach ($agent as $regex) { if (preg_match($regex, $this->server['HTTP_USER_AGENT'])) { return true; diff --git a/lib/private/template.php b/lib/private/template.php index 97666f0b8dc..1476a964ef3 100644 --- a/lib/private/template.php +++ b/lib/private/template.php @@ -143,7 +143,9 @@ class OC_Template extends \OC\Template\Base { OC_Util::addStyle("jquery.ocdialog"); OC_Util::addScript("compatibility", null, true); OC_Util::addScript("placeholders", null, true); - + OC_Util::addScript('files/fileinfo'); + OC_Util::addScript('files/client'); + // Add the stuff we need always // following logic will import all vendor libraries that are // specified in core/js/core.json @@ -158,7 +160,12 @@ class OC_Template extends \OC\Template\Base { } else { throw new \Exception('Cannot read core/js/core.json'); } - + + if (\OC::$server->getRequest()->isUserAgent([\OC\AppFramework\Http\Request::USER_AGENT_IE])) { + // shim for the davclient.js library + \OCP\Util::addScript('files/iedavclient'); + } + self::$initTemplateEngineFirstRun = false; } |