File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323use OCP \AppFramework \Http \Response ;
2424use OCP \AppFramework \Middleware ;
2525use OCP \Constants ;
26+ use OCP \Files \File ;
27+ use OCP \Files \Folder ;
2628use OCP \Files \IRootFolder ;
2729use OCP \Files \NotPermittedException ;
2830use OCP \IL10N ;
@@ -148,6 +150,17 @@ private function assertUserOrShareToken(ISessionAwareController $controller): vo
148150 throw new InvalidSessionException ();
149151 }
150152
153+ if ($ share ->getNodeType () === 'folder ' ) {
154+ $ folder = $ share ->getNode ();
155+ if (!$ folder instanceof Folder) {
156+ throw new InvalidSessionException ();
157+ }
158+ $ file = $ folder ->getFirstNodeById ($ documentId );
159+ if (!$ file instanceof File) {
160+ throw new InvalidSessionException ();
161+ }
162+ }
163+
151164 if ($ share ->getPassword () !== null ) {
152165 $ shareIds = $ this ->session ->get ('public_link_authenticated ' );
153166 $ shareIds = is_array ($ shareIds ) ? $ shareIds : [$ shareIds ];
You can’t perform that action at this time.
0 commit comments