index.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. /**
  3. * Copyright 2016, 2024 5 Mode
  4. * All Rights Reserved.
  5. *
  6. * This file is part of Simplicity.
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted provided that the following conditions are met:
  10. * * Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * * Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. * * Neither 5 Mode nor the names of its contributors
  16. * may be used to endorse or promote products derived from this software
  17. * without specific prior written permission.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  20. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  21. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  22. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY
  23. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  24. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  25. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  26. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  27. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  28. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29. *
  30. * index.php
  31. *
  32. * Simplicity index file.
  33. *
  34. * @author Daniele Bonini <my25mb@aol.com>
  35. * @copyrights (c) 2016, 2024 5 Mode
  36. */
  37. require "../Private/core/init.inc";
  38. // FUNCTION AND VARIABLE DECLARATIONS
  39. $scriptPath = APP_SCRIPT_PATH;
  40. // PARAMETERS VALIDATION
  41. $url = filter_input(INPUT_GET, "url")??"";
  42. $url = strip_tags($url);
  43. $url = strtolower(trim(substr($url, 0, 300), "/"));
  44. switch ($url) {
  45. case "action":
  46. $scriptPath = APP_AJAX_PATH;
  47. define("SCRIPT_NAME", "action");
  48. define("SCRIPT_FILENAME", "action.php");
  49. break;
  50. case "":
  51. case "home":
  52. define("SCRIPT_NAME", "home");
  53. define("SCRIPT_FILENAME", "home.php");
  54. break;
  55. default:
  56. $scriptPath = APP_ERROR_PATH;
  57. define("SCRIPT_NAME", "err-404");
  58. define("SCRIPT_FILENAME", "err-404.php");
  59. break;
  60. }
  61. require $scriptPath . "/" . SCRIPT_FILENAME;