summaryrefslogtreecommitdiffstats
path: root/apps/dav
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav')
-rw-r--r--apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php2
-rw-r--r--apps/dav/lib/Files/BrowserErrorPagePlugin.php13
-rw-r--r--apps/dav/templates/exception.php13
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php25
4 files changed, 13 insertions, 40 deletions
diff --git a/apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php b/apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php
index 5d39d83a287..616816d3496 100644
--- a/apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php
@@ -68,7 +68,7 @@ class BlockLegacyClientPlugin extends ServerPlugin {
return;
}
- $minimumSupportedDesktopVersion = $this->config->getSystemValue('minimum.supported.desktop.version', '1.7.0');
+ $minimumSupportedDesktopVersion = $this->config->getSystemValue('minimum.supported.desktop.version', '2.0.0');
// Match on the mirall version which is in scheme "Mozilla/5.0 (%1) mirall/%2" or
// "mirall/%1" for older releases
diff --git a/apps/dav/lib/Files/BrowserErrorPagePlugin.php b/apps/dav/lib/Files/BrowserErrorPagePlugin.php
index b58ce4df874..d6fad50b40d 100644
--- a/apps/dav/lib/Files/BrowserErrorPagePlugin.php
+++ b/apps/dav/lib/Files/BrowserErrorPagePlugin.php
@@ -80,28 +80,19 @@ class BrowserErrorPagePlugin extends ServerPlugin {
}
$this->server->httpResponse->addHeaders($headers);
$this->server->httpResponse->setStatus($httpCode);
- $body = $this->generateBody($ex);
+ $body = $this->generateBody();
$this->server->httpResponse->setBody($body);
$this->sendResponse();
}
/**
* @codeCoverageIgnore
- * @param \Exception $exception
* @return bool|string
*/
- public function generateBody(\Exception $exception) {
+ public function generateBody() {
$request = \OC::$server->getRequest();
$content = new OC_Template('dav', 'exception', 'guest');
$content->assign('title', $this->server->httpResponse->getStatusText());
- $content->assign('message', $exception->getMessage());
- $content->assign('errorClass', get_class($exception));
- $content->assign('errorMsg', $exception->getMessage());
- $content->assign('errorCode', $exception->getCode());
- $content->assign('file', $exception->getFile());
- $content->assign('line', $exception->getLine());
- $content->assign('trace', $exception->getTraceAsString());
- $content->assign('debugMode', \OC::$server->getSystemConfig()->getValue('debug', false));
$content->assign('remoteAddr', $request->getRemoteAddress());
$content->assign('requestID', $request->getId());
return $content->fetchPage();
diff --git a/apps/dav/templates/exception.php b/apps/dav/templates/exception.php
index c4abd205bfc..dbed8d3b654 100644
--- a/apps/dav/templates/exception.php
+++ b/apps/dav/templates/exception.php
@@ -30,18 +30,5 @@ style('core', ['styles', 'header']);
<ul>
<li><?php p($l->t('Remote Address: %s', $_['remoteAddr'])) ?></li>
<li><?php p($l->t('Request ID: %s', $_['requestID'])) ?></li>
- <?php if($_['debugMode']): ?>
- <li><?php p($l->t('Type: %s', $_['errorClass'])) ?></li>
- <li><?php p($l->t('Code: %s', $_['errorCode'])) ?></li>
- <li><?php p($l->t('Message: %s', $_['errorMsg'])) ?></li>
- <li><?php p($l->t('File: %s', $_['file'])) ?></li>
- <li><?php p($l->t('Line: %s', $_['line'])) ?></li>
- <?php endif; ?>
</ul>
-
- <?php if($_['debugMode']): ?>
- <br />
- <h2><strong><?php p($l->t('Trace')) ?></strong></h2>
- <pre><?php p($_['trace']) ?></pre>
- <?php endif; ?>
</span>
diff --git a/apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php
index 933460a630c..eb1689089a4 100644
--- a/apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php
@@ -26,6 +26,7 @@
namespace OCA\DAV\Tests\unit\Connector\Sabre;
use OCA\DAV\Connector\Sabre\BlockLegacyClientPlugin;
+use PHPUnit_Framework_MockObject_MockObject;
use Test\TestCase;
use OCP\IConfig;
@@ -35,7 +36,7 @@ use OCP\IConfig;
* @package OCA\DAV\Tests\unit\Connector\Sabre
*/
class BlockLegacyClientPluginTest extends TestCase {
- /** @var IConfig */
+ /** @var IConfig | \PHPUnit_Framework_MockObject_MockObject */
private $config;
/** @var BlockLegacyClientPlugin */
private $blockLegacyClientVersionPlugin;
@@ -69,10 +70,8 @@ class BlockLegacyClientPluginTest extends TestCase {
* @expectedExceptionMessage Unsupported client version.
*/
public function testBeforeHandlerException($userAgent) {
- /** @var \Sabre\HTTP\RequestInterface $request */
- $request = $this->getMockBuilder('\Sabre\HTTP\RequestInterface')
- ->disableOriginalConstructor()
- ->getMock();
+ /** @var \Sabre\HTTP\RequestInterface | PHPUnit_Framework_MockObject_MockObject $request */
+ $request = $this->createMock('\Sabre\HTTP\RequestInterface');
$request
->expects($this->once())
->method('getHeader')
@@ -82,7 +81,7 @@ class BlockLegacyClientPluginTest extends TestCase {
$this->config
->expects($this->once())
->method('getSystemValue')
- ->with('minimum.supported.desktop.version', '1.7.0')
+ ->with('minimum.supported.desktop.version', '2.0.0')
->will($this->returnValue('1.7.0'));
$this->blockLegacyClientVersionPlugin->beforeHandler($request);
@@ -106,10 +105,8 @@ class BlockLegacyClientPluginTest extends TestCase {
* @param string $userAgent
*/
public function testBeforeHandlerSuccess($userAgent) {
- /** @var \Sabre\HTTP\RequestInterface $request */
- $request = $this->getMockBuilder('\Sabre\HTTP\RequestInterface')
- ->disableOriginalConstructor()
- ->getMock();
+ /** @var \Sabre\HTTP\RequestInterface | PHPUnit_Framework_MockObject_MockObject $request */
+ $request = $this->createMock('\Sabre\HTTP\RequestInterface');
$request
->expects($this->once())
->method('getHeader')
@@ -119,17 +116,15 @@ class BlockLegacyClientPluginTest extends TestCase {
$this->config
->expects($this->once())
->method('getSystemValue')
- ->with('minimum.supported.desktop.version', '1.7.0')
+ ->with('minimum.supported.desktop.version', '2.0.0')
->will($this->returnValue('1.7.0'));
$this->blockLegacyClientVersionPlugin->beforeHandler($request);
}
public function testBeforeHandlerNoUserAgent() {
- /** @var \Sabre\HTTP\RequestInterface $request */
- $request = $this->getMockBuilder('\Sabre\HTTP\RequestInterface')
- ->disableOriginalConstructor()
- ->getMock();
+ /** @var \Sabre\HTTP\RequestInterface | PHPUnit_Framework_MockObject_MockObject $request */
+ $request = $this->createMock('\Sabre\HTTP\RequestInterface');
$request
->expects($this->once())
->method('getHeader')