This is a bit of an oddity for me. PHP is my forte, and I can normally figure out any issue I encounter.
I have a custom framework that I have been using for years. I have taken it upon myself to rewrite it, and I'm doing everything essentially the same that I was before. The problem lies in the following construct:
function ModPages_GetPage() {
$page = ModPages_GetPageByName($_GET['page_name']);
if($page != false) {
include(TPL_DIR.'pages/pages.view.php');
} else {
ErrorMessage('Invalid Page', 'The selected page could not be found.');
}
}
function ModPages_GetPageByName($page_name = null) {
$db = new Database;
$query = '
SELECT *
FROM pages
WHERE page_name = "'.CleanStr($page_name).'"
AND page_enabled = "yes"
LIMIT 1
';
$page = $db->GetRow($query);
return $page;
}
This code is being called with 'home' for the value of $_GET['page_name']
. The call to ModPages_GetPageByName()
is working fine, but the value of $page
in ModPages_GetPage()
isn't getting set. Matter of fact, any debugging statements thrown in after that call are failing to display anything.
I have display_errors
set to on
, and error_reporting
set to E_ALL
. I get a couple notices from my Database class, but that's it.
Running the script at a shell fails to produce any errors. When using strace
, I do see the process spits out an 'exit_group(255)'.
This one has me quite baffled. I could sure use some direction on this.