diff --git a/apps/dav/tests/unit/Connector/Sabre/AuthTest.php b/apps/dav/tests/unit/Connector/Sabre/AuthTest.php index f94afb257de80..a449b8f9431f3 100644 --- a/apps/dav/tests/unit/Connector/Sabre/AuthTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/AuthTest.php @@ -303,7 +303,7 @@ public function testAuthenticateAlreadyLoggedInWithoutCsrfTokenAndCorrectlyDavAu ->method('isUserAgent') ->with([ '/^Mozilla\/5\.0 \([A-Za-z ]+\) (mirall|csyncoC)\/.*$/', - '/^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/', + '/^Mozilla\/5\.0 \(Android\) (ownCloud|Nextcloud)\-android.*$/', '/^Mozilla\/5\.0 \(iOS\) (ownCloud|Nextcloud)\-iOS.*$/', ]) ->willReturn(false); @@ -407,7 +407,7 @@ public function testAuthenticateAlreadyLoggedInWithoutCsrfTokenAndIncorrectlyDav ->method('isUserAgent') ->with([ '/^Mozilla\/5\.0 \([A-Za-z ]+\) (mirall|csyncoC)\/.*$/', - '/^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/', + '/^Mozilla\/5\.0 \(Android\) (ownCloud|Nextcloud)\-android.*$/', '/^Mozilla\/5\.0 \(iOS\) (ownCloud|Nextcloud)\-iOS.*$/', ]) ->willReturn(false); @@ -453,7 +453,7 @@ public function testAuthenticateAlreadyLoggedInWithoutCsrfTokenForNonGetAndDeskt ->method('isUserAgent') ->with([ '/^Mozilla\/5\.0 \([A-Za-z ]+\) (mirall|csyncoC)\/.*$/', - '/^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/', + '/^Mozilla\/5\.0 \(Android\) (ownCloud|Nextcloud)\-android.*$/', '/^Mozilla\/5\.0 \(iOS\) (ownCloud|Nextcloud)\-iOS.*$/', ]) ->willReturn(true); diff --git a/lib/public/IRequest.php b/lib/public/IRequest.php index c4f59f85d4ab1..a14b6b5f459c4 100644 --- a/lib/public/IRequest.php +++ b/lib/public/IRequest.php @@ -67,7 +67,7 @@ interface IRequest { /** * @since 9.1.0 */ - const USER_AGENT_CLIENT_ANDROID = '/^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/'; + const USER_AGENT_CLIENT_ANDROID = '/^Mozilla\/5\.0 \(Android\) (ownCloud|Nextcloud)\-android.*$/'; /** * @since 13.0.0 diff --git a/tests/lib/AppFramework/Http/RequestTest.php b/tests/lib/AppFramework/Http/RequestTest.php index d3f36a6d886cf..cc55e33f354c1 100644 --- a/tests/lib/AppFramework/Http/RequestTest.php +++ b/tests/lib/AppFramework/Http/RequestTest.php @@ -859,6 +859,20 @@ function userAgentProvider() { ], false, ], + [ + 'Mozilla/5.0 (Android) ownCloud-android/2.0.0', + [ + Request::USER_AGENT_CLIENT_ANDROID + ], + true, + ], + [ + 'Mozilla/5.0 (Android) Nextcloud-android/2.0.0', + [ + Request::USER_AGENT_CLIENT_ANDROID + ], + true, + ], ]; }