File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222use OCP \AppFramework \Http \Response ;
2323use OCP \AppFramework \Middleware ;
2424use OCP \Constants ;
25+ use OCP \Files \File ;
26+ use OCP \Files \Folder ;
2527use OCP \Files \IRootFolder ;
2628use OCP \Files \NotPermittedException ;
2729use OCP \IL10N ;
@@ -136,6 +138,17 @@ private function assertUserOrShareToken(ISessionAwareController $controller): vo
136138 throw new InvalidSessionException ();
137139 }
138140
141+ if ($ share ->getNodeType () === 'folder ' ) {
142+ $ folder = $ share ->getNode ();
143+ if (!$ folder instanceof Folder) {
144+ throw new InvalidSessionException ();
145+ }
146+ $ file = $ folder ->getFirstNodeById ($ documentId );
147+ if (!$ file instanceof File) {
148+ throw new InvalidSessionException ();
149+ }
150+ }
151+
139152 if ($ share ->getPassword () !== null ) {
140153 $ shareIds = $ this ->session ->get ('public_link_authenticated ' );
141154 $ shareIds = is_array ($ shareIds ) ? $ shareIds : [$ shareIds ];
You can’t perform that action at this time.
0 commit comments