Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tutor_permission_denied_template): call die() instead of return to correctly end execution of code #685

Closed

Conversation

pano9000
Copy link

@pano9000 pano9000 commented Feb 13, 2024

The code was previously using to "return" at the end of the function to stop execution of code.

The way the tutor_permission_denied_template is used though, returning will not help -> you need to use die() to halt further execution.

e.g. you can see that issue here:
https://demo.themeum.com/tutor/dashboard/create-course/?course_ID=7773

The template is from tutor-pro / frontend-course-builder.php:

in there code does two checks, that are supposed to stop printing the course-builder template - however they use the tutor_permission_denied_template function, which just returns, so execution just goes on, and everything is printed anyways.
(e.g. it also therefore prints the "permission denied template" twice, because it is called twice.)

fixes #686

@pano9000 pano9000 changed the title fix(tutor_permission_denied_template): call die() instead of return t… fix(tutor_permission_denied_template): call die() instead of return to correctly end execution of code Feb 13, 2024
@pano9000 pano9000 changed the base branch from master to dev February 14, 2024 14:11
@pano9000
Copy link
Author

pinging @harunollyo @shewa12 to kindly get a closer look at this

@shewa12 shewa12 closed this Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unauthenticated users can see Course Builder
3 participants