I have a sticky wicket here and don't want to even attempt any changes without checking with more-experienced Drupalers first. I hope Angie the amazing webchick reads this (I've seen recent commits by her on the core filter.module code), but anyway here goes...
I keep finding identical errors in our dblog, saying:
"md5() expects parameter 1 to be string, array given in /var/www/beta/modules/filter/filter.module on line 435."
If you know a solid fix for this without reading more, I'm all eyes and would really appreciate help! I've searched far and wide, and have come up with some "seemingly related" 'patches,' yet due to its security-relatedness I know not to patch this core module without 100% confidence it's still secure (and SQL-injection scripting as a site hijack technique isn't something I know much about... so seems to me it'stime to check with a real guru).
Anyway, here's the allegedly error-causing code section of the filter.module:
429 function check_markup($text, $format = FILTER_FORMAT_DEFAULT, $check = TRUE) {
430 // When $check = TRUE, do an access check on $format.
431 if (isset($text) && (!$check || filter_access($format))) {
432 $format = filter_resolve_format($format);
433
434 // Check for a cached version of this piece of text.
435 $cache_id = $format .':'. md5($text); <-- with Notepad++ PHP context highlighting on it looks okay, but maybe it's missing code/syntax? -->
436 if ($cached = cache_get($cache_id, 'cache_filter')) {
437 return $cached->data;
438 }
I found this snippet with a similar statement (in the D 4.7 filter.module):
function check_markup($text, $format = FILTER_FORMAT_DEFAULT, $check = TRUE) {
// When $check = true, do an access check on $format.
if (isset($text) && (!$check || filter_access($format))) {
$format = filter_resolve_format($format);
// Check for a cached version of this piece of text.)
$id = 'filter:'. $format .':'. md5($text); <-- 'same' md5() work here, it seems (but using `$id` [not `$cache_id`] var, plus added term `'filter:'.`. Hmm, sadly, being largely a non-PHP guy until now, it's Greek to me) -->
if ($cached = cache_get($id)) {
return $cached->data;
}
Do you suppose I'm onto something that can fix the md5() function's database errors? Or is it being caused in a source/target of this? A quick bit of my local history/Drupal installation pathology, in case it matters:
Using D 6.19. Not sure when the present error began, because when recently updating many contrib mods, I cleared out a succession of errors one at a time, and didn't dig much deeper into the log which was crammed with a variety of errors probably including this one buried farther down. I'm hoping this is nearly the last one (site performance is gradually improving, but something is still churning, if only to log the errors noted at top of this post. **I allegedly fixed an error in Views by rolling that module from a more-current dev version back to verion 6x.2.11.** Now this error has bubbled up on my radar, but I'm a little perplexed!
I hope someone can help me fix this (or offer a little guidance as to where I should turn next). Before I melt my PHP-deprived brain sifting through code with which I'm unfamiliar, I may even be willing to hire someone to make it right. I would prefer that someone just post a fix here so we can all get past this bugaboo!
Comments
I don't know what exactly the
I don't know what exactly the problem is, but I would try running dpm (it's a function from devel-module) on the $text var, and see what it says. The arrays content can probably help shed some light on the issue. Good luck.
$cache_id = $format .':'. md5($text);
Thanks!
Thank you, very good suggestion.
any luck with this error?
I get this error too after updating some modules. Any help is appreciated!