Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/gallery.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Paroz <oparoz@users.noreply.github.com>2016-07-09 01:56:55 +0300
committerGitHub <noreply@github.com>2016-07-09 01:56:55 +0300
commiteaba09046a1a69f09f54afefb4899c994d61bb97 (patch)
treefaaa55ccfbafc852e331cd9067cbdde1546f5473
parent61920fd80f0885bb51069d72e739a45f45f92549 (diff)
parent7e02ae2d574f0c01052617d8f462026ca14e74b3 (diff)
Merge pull request #690 from owncloud/stable9.1-stringidfixv9.1.2RC1v9.1.1RC3v9.1.1RC2v9.1.1RC1v9.1.1v9.1.0RC4v9.1.0RC3v9.1.0RC2
[stable9.1] Fix for string id
-rw-r--r--middleware/envcheckmiddleware.php4
-rw-r--r--tests/unit/middleware/EnvCheckMiddlewareTest.php8
2 files changed, 6 insertions, 6 deletions
diff --git a/middleware/envcheckmiddleware.php b/middleware/envcheckmiddleware.php
index 8c9ee375..c2385c27 100644
--- a/middleware/envcheckmiddleware.php
+++ b/middleware/envcheckmiddleware.php
@@ -267,7 +267,7 @@ class EnvCheckMiddleware extends CheckMiddleware {
$newHash = '';
if ($this->shareManager->checkPassword($share, $password)) {
// Save item id in session for future requests
- $this->session->set('public_link_authenticated', $share->getId());
+ $this->session->set('public_link_authenticated', (string)$share->getId());
// @codeCoverageIgnoreStart
if (!empty($newHash)) {
// For future use
@@ -289,7 +289,7 @@ class EnvCheckMiddleware extends CheckMiddleware {
private function checkSession($share) {
// Not authenticated ?
if (!$this->session->exists('public_link_authenticated')
- || $this->session->get('public_link_authenticated') !== $share->getId()
+ || $this->session->get('public_link_authenticated') !== (string)$share->getId()
) {
throw new CheckException("Missing password", Http::STATUS_UNAUTHORIZED);
}
diff --git a/tests/unit/middleware/EnvCheckMiddlewareTest.php b/tests/unit/middleware/EnvCheckMiddlewareTest.php
index c744c492..aaef1922 100644
--- a/tests/unit/middleware/EnvCheckMiddlewareTest.php
+++ b/tests/unit/middleware/EnvCheckMiddlewareTest.php
@@ -214,8 +214,8 @@ class EnvCheckMiddlewareTest extends \Test\GalleryUnitTest {
public function testCheckSessionAfterPasswordEntry() {
$share = $this->mockShare('file', 'tester', 'image.png');
- $this->mockSessionExists($share->getId());
- $this->mockSessionWithShareId($share->getId());
+ $this->mockSessionExists((string)$share->getId());
+ $this->mockSessionWithShareId((string)$share->getId());
parent::invokePrivate($this->middleware, 'checkSession', [$share]);
}
@@ -365,8 +365,8 @@ class EnvCheckMiddlewareTest extends \Test\GalleryUnitTest {
Constants::PERMISSION_READ, $wrongPassword
);
- $this->mockSessionExists($share->getId());
- $this->mockSessionWithShareId($share->getId());
+ $this->mockSessionExists((string)$share->getId());
+ $this->mockSessionWithShareId((string)$share->getId());
parent::invokePrivate($this->middleware, 'checkAuthorisation', [$share, $password]);
}