[drupal-devel] [bug] make sure links are an array
Uwe Hermann
drupal-devel at drupal.org
Fri Apr 8 22:54:09 UTC 2005
Issue status update for http://drupal.org/node/18835
Project: Drupal
Version: cvs
Component: theme system
Category: bug reports
Priority: normal
Assigned to: Anonymous
Reported by: Olen
Updated by: Uwe Hermann
-Status: won't fix
+Status: patch
IMHO core should be programmed defensively and robust, and not fail on
errors which it could detect and react upon properly.
Uwe Hermann
Previous comments:
------------------------------------------------------------------------
March 13, 2005 - 15:55 : Olen
Had a bug in some module where theme_links was called but '$links' was
not an array.
Ofcourse the real bug was in the module, but I theme_links should maybe
not produce ugly errors if this happens?
--- theme.inc.orig 2005-03-13 14:51:45.829133700 +0100
+++ theme.inc 2005-03-13 14:46:55.000000000 +0100
@@ -432,7 +432,9 @@
* A string containing the themed links.
*/
function theme_links($links, $delimiter = ' | ') {
- return implode($delimiter, $links);
+ if (is_array($links)) {
+ return implode($delimiter, $links);
+ }
}
/**
------------------------------------------------------------------------
April 8, 2005 - 10:16 : chx
I do not think it is the task of core to correct the incorrect work of
non-core modules.
More information about the drupal-devel
mailing list