You have done a great job with Workflow and all that. But I am using Bitnami on Windows.
The moment I try to run the batch file (scheduler) on Windows it shows the following error
function clean_string($str, $filter = 'STANDARD', $dieOnBadData = true)
{
global $sugar_config;
$filters = array(
'STANDARD' => '#[^A-Z0-9\-_\.\@]#i',
'STANDARDSPACE' => '#[^A-Z0-9\-_\.\@\ ]#i',
'FILE' => '#[^A-Z0-9\-_\.]#i',
'NUMBER' => '#[^0-9\-]#i',
'SQL_COLUMN_LIST' => '#[^A-Z0-9\(\),_\.]#i',
'PATH_NO_URL' => '#://#i',
'SAFED_GET' => '#[^A-Z0-9\@\=\&\?\.\/\-_~+]#i', /* range of allowed characters in a GET string */
'UNIFIED_SEARCH' => '#[\\x00]#', /* cn: bug 3356 & 9236 - MBCS search strings */
'AUTO_INCREMENT' => '#[^0-9\-,\ ]#i',
'ALPHANUM' => '#[^A-Z0-9\-]#i',
);
if (preg_match($filters[$filter], $str)) {
if (isset($GLOBALS['log']) && is_object($GLOBALS['log'])) {
$GLOBALS['log']->fatal("SECURITY[$filter]: bad data passed in; string: {$str}");
}
if ($dieOnBadData) {
die("Bad data passed in; <a href=\"{$sugar_config['site_url']}\">Return to Home</a>");
}
return false;
} else {
return $str;
}
}
You can see that apart from the error shown on screen, there is an error in the logs, like this āSECURITY[$filter]: bad data passed in; string: {$str}ā. If you look at that log entry, you will know exactly which string is hitting the security filters.
i edited the message to be āI can see bad dataā so that i can debug. I donāt know what is wrongā¦ and the debug doesnāt say which variable seems to be wrong
function clean_string($str, $filter = āSTANDARDā, $dieOnBadData = true)
{
global $sugar_config;
$filters = array(
'STANDARD' => '#[^A-Z0-9\-_\.\@]#i',
'STANDARDSPACE' => '#[^A-Z0-9\-_\.\@\ ]#i',
'FILE' => '#[^A-Z0-9\-_\.]#i',
'NUMBER' => '#[^0-9\-]#i',
'SQL_COLUMN_LIST' => '#[^A-Z0-9\(\),_\.]#i',
'PATH_NO_URL' => '#://#i',
'SAFED_GET' => '#[^A-Z0-9\@\=\&\?\.\/\-_~+]#i', /* range of allowed characters in a GET string */
'UNIFIED_SEARCH' => '#[\\x00]#', /* cn: bug 3356 & 9236 - MBCS search strings */
'AUTO_INCREMENT' => '#[^0-9\-,\ ]#i',
'ALPHANUM' => '#[^A-Z0-9\-]#i',
);
if (preg_match($filters[$filter], $str)) {
if (isset($GLOBALS['log']) && is_object($GLOBALS['log'])) {
$GLOBALS['log']->fatal("SECURITY[$filter]: bad data passed in; string: {$str}");
}
if ($dieOnBadData) {
die("I can see Bad data passed in; <a href=\"{$sugar_config['site_url']}\">Return to Home</a>");
}
return false;
} else {
return $str;
}
I seem to have solved itā¦ still need some testing thoughā¦
In the variable i removed the brackets [ ] from the function it seemed to work. I wish someone could make use of this, as i spun around this for so long!
Firtst of all, google about suitecrm.log, you should really know about that, itās a basic element of your survival with this project.
Then, your edited function is not correct - you would need to print out the $str before the ādieā statement. Itās worth trying so we know exactly which string is causing trouble.
And your change of the brackets may solve your problem for now, but itās not an appropriate fix. You should leave that string as it is because itās doing a security check, you just bypassed it.
Your real problem is elsewhere, you should investigate further.
Also, remember that these changes directly on core files may get overriden whenever you upgrade.
Hhmm I donāt know the specifics of that code, but probably you shouldnāt be seeing a DOS path there (in a HTTP GET command), you should probably have a web server path (perhaps simply ācron.phpā), since it is on the root directory of the site.
That all boils down to this question: how to correctly configure schedulers on WIndows with Bitnami?
If you remove the brackets youāre just breaking the regex expression to make it meaningless. Then anybody can build URLās against your site using illegal characters. I donāt know what tricks that allows for, but it does not seem like a good idea at all.
And most importantly, I canāt believe that your schedulers are working, they donāt seem properly configured. You might get past the error, but will it work?
You could reply in that post in the Bitnami forums, that guy who promised a solution could try getting you one.
Iām curious about this: what exactly are you doing to get this error? If youāre seeing the ādieā error on screen then youāre not inside a scheduler, are you? Scheduler jobs donāt open browser Windows.
Can you please explain step-by-step what you do to get the error showing?