@@ -46,6 +46,7 @@ public function __construct($appName,
4646 * @PublicPage
4747 * @NoAdminRequired
4848 * @NoCSRFRequired
49+ * @NoSameSiteCookieRequired
4950 */
5051 public function index ()
5152 {
@@ -63,6 +64,7 @@ public function index()
6364 * @PublicPage
6465 * @NoAdminRequired
6566 * @NoCSRFRequired
67+ * @NoSameSiteCookieRequired
6668 */
6769 public function handle ($ uid , $ path )
6870 {
@@ -159,10 +161,11 @@ private function isShared($uid, $path)
159161 $ now = time ();
160162 $ shared = false ;
161163 for ($ i = $ len ; $ i > 0 ; $ i --) {
162- $ tmpPath = implode (DIRECTORY_SEPARATOR , array_slice ($ segments , 0 , $ i ));
163- $ userPath = $ this ->rootFolder ->getUserFolder ($ uid )->get ($ tmpPath );
164- $ shares = $ this ->shareManager ->getSharesBy ($ uid , IShare::TYPE_LINK , $ userPath );
165- $ share = $ shares [0 ] ?? null ;
164+ $ tmpPath = implode (DIRECTORY_SEPARATOR , array_slice ($ segments , 0 , $ i ));
165+ $ userPath = $ this ->rootFolder ->getUserFolder ($ uid )->get ($ tmpPath );
166+ $ shareType = version_compare (\OC_Util::getVersionString (), '17.0.0 ' , '>= ' ) ? IShare::TYPE_LINK : OC \Share \Constants::SHARE_TYPE_LINK ;
167+ $ shares = $ this ->shareManager ->getSharesBy ($ uid , $ shareType , $ userPath );
168+ $ share = $ shares [0 ] ?? null ;
166169
167170 // shared but checked hide download or password protect or expired
168171 if ($ share && (
0 commit comments