File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717use OCP \AppFramework \Http \Response ;
1818use OCP \AppFramework \Middleware ;
1919use OCP \Constants ;
20+ use OCP \Files \File ;
21+ use OCP \Files \Folder ;
2022use OCP \Files \IRootFolder ;
2123use OCP \Files \NotPermittedException ;
2224use OCP \IL10N ;
@@ -131,6 +133,17 @@ private function assertUserOrShareToken(ISessionAwareController $controller): vo
131133 throw new InvalidSessionException ();
132134 }
133135
136+ if ($ share ->getNodeType () === 'folder ' ) {
137+ $ folder = $ share ->getNode ();
138+ if (!$ folder instanceof Folder) {
139+ throw new InvalidSessionException ();
140+ }
141+ $ file = $ folder ->getFirstNodeById ($ documentId );
142+ if (!$ file instanceof File) {
143+ throw new InvalidSessionException ();
144+ }
145+ }
146+
134147 if ($ share ->getPassword () !== null ) {
135148 $ shareIds = $ this ->session ->get ('public_link_authenticated ' );
136149 $ shareIds = is_array ($ shareIds ) ? $ shareIds : [$ shareIds ];
You can’t perform that action at this time.
0 commit comments