From aecede9ab28e777bc0aa5dbaebc908fa0f2b2abb Mon Sep 17 00:00:00 2001 From: Andreas Hennings Date: Tue, 11 Feb 2014 20:35:41 +0100 Subject: [PATCH] Explicit checks for external symbols. --- CRM/Utils/System/Base.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CRM/Utils/System/Base.php b/CRM/Utils/System/Base.php index d388098d59..c56c371bc6 100644 --- a/CRM/Utils/System/Base.php +++ b/CRM/Utils/System/Base.php @@ -92,6 +92,12 @@ abstract class CRM_Utils_System_Base { !$print && $config->userFramework == 'WordPress' ) { + if (!function_exists('is_admin')) { + throw new \Exception('Function "is_admin()" is missing, even though WordPress is the user framework.'); + } + if (!defined('ABSPATH')) { + throw new \Exception('Constant "ABSPATH" is not defined, even though WordPress is the user framework.'); + } if (is_admin()) { require_once (ABSPATH . 'wp-admin/admin-header.php'); } -- 2.25.1