404 page rather than die if plugin in not enabled

vincent3569 Member, Translator
I don't know if it is an issue or not, so I post here first.

In offical theme, with contat.php and register.php, there is a 404 page if relevant plugins are not enabled.

why the same behavior is not the same with news.php, pages.php, favorites.php and slideshow.php, if relevant plugins are not enabled?

there is the same question with search page. this is not a plugin but you may disable search in theme options, but you can access to the page in front end (with the right url in the browser).

Comments

  • vincent3569 Member, Translator
    and as far I can see, if the code of contact.php and register.php is without these first and last lines (example with register):

    `if (function_exists('printRegistrationForm')) {`

    and

    `
    } else {
    include(SERVERPATH . '/' . ZENFOLDER . '/404.php');
    `
    the behaviour is the same, and we have a 404 error.
  • acrylian Administrator, Developer
    Cannot really be. Custom theme pages can always be accessed directly, independent what functions of what plugins they use.

    However I have to admit I learned about this change as well.
  • The same code would need to be placed in each script to cause the 404 error. I guess we never thought of putting it in pages.php and news.php since those are normally linked by URLs instead of the pages.php direct link. The URL link will give the 404 error if the zenpage plugin is disabled. Linking directly is considered "forbidden" thus the `die()`
  • On further review thess all should exhibit the same behavior. Otherwise they tend to throw errors if you access them and the plugin is not enabled.
Sign In or Register to comment.