# HG changeset patch # User Nathan Phillip Brink # Date 2011-04-09 13:29:31 # Node ID 73b131aa114b912333071db6d1dd8198280c4549 # Parent b181890c13e4c9ba49dda011fdeb21cdaab23b20 Completely disallow calling `new page()'. Use page::page_create() instead. diff --git a/ajax.php b/ajax.php --- a/ajax.php +++ b/ajax.php @@ -76,7 +76,7 @@ if (isset($_REQUEST['school_registration slate_permutate_json_error('Unable to load any school.'); } - $page = new Page('', array(), FALSE); + $page = page::page_create(''); $courses = array(); if (!empty($_REQUEST['courses']) && is_array($_REQUEST['courses'])) diff --git a/inc/class.page.php b/inc/class.page.php --- a/inc/class.page.php +++ b/inc/class.page.php @@ -93,6 +93,14 @@ class page private $school_semester_constant; /** + * \brief + * Construct a new page. + * + * Only to be called by page::page_construct(). Use that function + * instead of the new keyword. + * + * \see page::page_construct() + * * \param $ntitle * Must be a valid HTML string (i.e., escaped with htmlentities()). * \param $nscripts @@ -102,7 +110,7 @@ class page * - 'school': The school to use instead of the autodetected one. * - 'semester': The semester to use instead of the autodetected one. */ - public function __construct($ntitle, $nscripts = array(), $immediate = TRUE, array $options = array()) + protected function __construct($ntitle, $nscripts = array(), $immediate = TRUE, array $options = array()) { /* Begin tracking generation time */ $this->pageGenTime = round(microtime(),4);