I found a funky error, I hope it’s not linked to my connector because I wouldn’t know where to look to be frank.
[2010-08-18 08:35:05] (ERROR @ C:\wamp\www\modx\core\model\modx\modcontext.class.php : 68) PHP warning: Missing argument 2 for modContext::getOption(), called in C:\wamp\www\modx\core\model\modx\processors\system\config.js.php on line 31 and defined
[2010-08-18 08:35:05] (ERROR @ C:\wamp\www\modx\core\model\modx\modcontext.class.php : 68) PHP warning: Missing argument 2 for modContext::getOption(), called in C:\wamp\www\modx\core\model\modx\processors\system\config.js.php on line 31 and defined
[2010-08-18 08:35:05] (ERROR @ C:\wamp\www\modx\core\model\modx\modcontext.class.php : 68) PHP warning: Missing argument 2 for modContext::getOption(), called in C:\wamp\www\modx\core\model\modx\processors\system\config.js.php on line 33 and defined
[2010-08-18 08:35:05] (ERROR @ C:\wamp\www\modx\core\model\modx\modcontext.class.php : 68) PHP warning: Missing argument 2 for modContext::getOption(), called in C:\wamp\www\modx\core\model\modx\processors\system\config.js.php on line 34 and defined
[2010-08-18 08:35:05] (ERROR @ C:\wamp\www\modx\core\model\modx\modcontext.class.php : 68) PHP warning: Missing argument 2 for modContext::getOption(), called in C:\wamp\www\modx\core\model\modx\processors\system\config.js.php on line 36 and defined
In the code: ($template_url is on line 31);
$template_url = $context->getOption('manager_url').'templates/'.$context->getOption('manager_theme').'/';
$c = array(
'base_url' => $context->getOption('base_url'),
'connectors_url' => $context->getOption('connectors_url'),
'icons_url' => $template_url.'images/ext/modext/',
'manager_url' => $context->getOption('manager_url'),
'template_url' => $template_url,
'http_host' => $context->getOption('http_host',null,MODX_HTTP_HOST),
'site_url' => $context->getOption('site_url',null,MODX_SITE_URL),
'http_host_remote' => MODX_URL_SCHEME.$_SERVER['HTTP_HOST'],
'user' => $modx->user->get('id'),
'version' => $modx->version['full_version'],
'custom_resource_classes' => $customResourceClasses,
);
Oh and one other funny thing is, this function obviously sanitized the requests, post, cookie and get variable. Seeing that, I don’t know why it still submits $_GET/$_REQUEST[’q’] as ’undefined’.
/**
* Harden GPC variables by removing any MODx tags, Javascript, or entities.
*/
public function sanitizeRequest() {
$modxtags = array_values($this->modx->sanitizePatterns);
modX :: sanitize($_GET, $modxtags, 0);
if ($this->modx->getOption('allow_tags_in_post',null,true)) {
modX :: sanitize($_POST);
} else {
modX :: sanitize($_POST, $modxtags);
}
modX :: sanitize($_COOKIE, $modxtags);
modX :: sanitize($_REQUEST, $modxtags);
$rAlias = $this->modx->getOption('request_param_alias',null,'q');
if (isset ($_GET[$rAlias])) {
$_GET[$rAlias] = preg_replace("/[^A-Za-z0-9_\-\.\/]/", "", $_GET[$rAlias]);
}
}
It clearly reads
if isset then..., but it does it anyway. I’ve checked through the mail test (mailing me a print_r dump of post, get, request, server and cookie).