The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
verify.php bug and possible solution.
#8
Looking at the code starting at line 25 on
Code:
header.php
(included in every US page) we have this:

Code:
//check for a custom page
Code:
$currentPage = currentPage();
Code:
if(file_exists($abs_us_root.$us_url_root.'usersc/'.$currentPage)){
Code:
if(currentFolder()!= 'usersc'){
Code:
Redirect::to($us_url_root.'usersc/'.$currentPage);
Code:
}
Code:
}

Here is the definition, roughly, of
Code:
currentPage()
(I've simplified it for brevity):

Code:
return(basename($_SERVER['PHP_SELF']));

So if there is a page existing in
Code:
usersc/
then this redirection will happen automatically and it will happen to an absolute path so that there is no ambiguity about that. Choosing a consistent way to specify Redirect:too() arguments will not harm the ability to override pages with
Code:
usersc/
.

Where I sometimes have questions is with the scripts that are require_once'd (i.e., not a "page" per-se). It appears that these are require_once'd from init.php with an absolute path and no use of include_path or anything. I *think* this means that
Code:
usersc/
cannot be used to "override" scripts which are include'd or require'd. But that's a totally different question, unrelated to the Redirect.php class.
  Reply


Messages In This Thread
verify.php bug and possible solution. - by mudmin - 09-06-2016, 01:51 PM
verify.php bug and possible solution. - by mudmin - 09-07-2016, 10:28 PM
verify.php bug and possible solution. - by plb - 09-08-2016, 05:04 AM
verify.php bug and possible solution. - by plb - 09-08-2016, 05:56 AM
verify.php bug and possible solution. - by plb - 09-09-2016, 06:44 AM
verify.php bug and possible solution. - by brian - 09-09-2016, 12:37 PM
verify.php bug and possible solution. - by brian - 09-09-2016, 12:40 PM
verify.php bug and possible solution. - by brian - 09-09-2016, 04:18 PM
verify.php bug and possible solution. - by plb - 09-11-2016, 09:22 AM
verify.php bug and possible solution. - by mudmin - 09-11-2016, 12:46 PM
verify.php bug and possible solution. - by plb - 09-11-2016, 03:36 PM
verify.php bug and possible solution. - by mudmin - 09-11-2016, 06:31 PM

Forum Jump:


Users browsing this thread: 4 Guest(s)