summaryrefslogtreecommitdiffstats
path: root/lib/private/Session/Internal.php
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@owncloud.com>2016-04-26 09:29:15 +0200
committerChristoph Wurst <christoph@owncloud.com>2016-04-26 14:51:21 +0200
commite93bf80b29cde236c5d78023b49435283e4b2562 (patch)
tree3640e7778974a0577f0eaf6661280bb76edceaa1 /lib/private/Session/Internal.php
parent0d53e86421faef0300d509b385934754b4dab88c (diff)
downloadnextcloud-server-e93bf80b29cde236c5d78023b49435283e4b2562.tar.gz
nextcloud-server-e93bf80b29cde236c5d78023b49435283e4b2562.zip
throw SessionNotAvailableException if session_id returns empty string
Diffstat (limited to 'lib/private/Session/Internal.php')
-rw-r--r--lib/private/Session/Internal.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/private/Session/Internal.php b/lib/private/Session/Internal.php
index 4fadb1ac801..a24aec55222 100644
--- a/lib/private/Session/Internal.php
+++ b/lib/private/Session/Internal.php
@@ -26,6 +26,8 @@
namespace OC\Session;
+use OCP\Session\Exceptions\SessionNotAvailableException;
+
/**
* Class Internal
*
@@ -115,10 +117,15 @@ class Internal extends Session {
* Wrapper around session_id
*
* @return string
+ * @throws SessionNotAvailableException
* @since 9.1.0
*/
public function getId() {
- return @session_id();
+ $id = @session_id();
+ if ($id === '') {
+ throw new SessionNotAvailableException();
+ }
+ return $id;
}
/**