File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change 1313 throw new fValidationException ('There cannot be .. or // in the path ' );
1414 }
1515
16- $ parent_path = Page::parentPage ($ page_path );
17- try {
18- $ parent = new Page (array ('path ' => $ parent_path ));
19- } catch (fNotFoundException $ e ) {
20- throw new fValidationException ('Please create the parent page first ' );
21- }
22- $ user_name = wiki_get_current_user ();
23- if (!$ parent ->isPermitted ($ user_name , 'create ' )) {
24- throw new fValidationException ('You are not permitted to create pages here! ' );
16+ if ($ page_path !='/ ' ) {
17+ $ parent_path = Page::parentPage ($ page_path );
18+ try {
19+ $ parent = new Page (array ('path ' => $ parent_path ));
20+ } catch (fNotFoundException $ e ) {
21+ throw new fValidationException ('Please create the parent page first ' );
22+ }
23+ $ user_name = wiki_get_current_user ();
24+ if (!$ parent ->isPermitted ($ user_name , 'create ' )) {
25+ throw new fValidationException ('You are not permitted to create pages here! ' );
26+ }
2527 }
2628
2729 $ body = fRequest::get ('body ' );
You can’t perform that action at this time.
0 commit comments