summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/common.inc5
-rw-r--r--includes/file.inc1
-rw-r--r--includes/module.inc5
3 files changed, 8 insertions, 3 deletions
diff --git a/includes/common.inc b/includes/common.inc
index e8080e7f0..72324c5f0 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -399,10 +399,10 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data =
* Log errors in the database rather than displaying them to the user.
*/
function error_handler($errno, $message, $filename, $line, $variables) {
- $types = array(1 => 'error', 2 => 'warning', 4 => 'parse error', 8 => 'notice', 16 => 'core error', 32 => 'core warning', 64 => 'compile error', 128 => 'compile warning', 256 => 'user error', 512 => 'user warning', 1024 => 'user notice');
+ $types = array(1 => 'error', 2 => 'warning', 4 => 'parse error', 8 => 'notice', 16 => 'core error', 32 => 'core warning', 64 => 'compile error', 128 => 'compile warning', 256 => 'user error', 512 => 'user warning', 1024 => 'user notice', 2048 => 'strict warning');
$entry = $types[$errno] .': '. $message .' in '. $filename .' on line '. $line .'.';
- if ($errno & E_ALL ^ E_NOTICE) {
+ if ($errno & (E_ALL ^ E_NOTICE)) {
watchdog('error', t('%error: %message in %file on line %line.', array('%error' => $types[$errno], '%message' => $message, '%file' => $filename, '%line' => $line)));
if (error_reporting()) {
print '<pre>'. $entry .'</pre>';
@@ -446,6 +446,7 @@ function fix_gpc_magic() {
*/
function array2object($array) {
if (is_array($array)) {
+ $object = new stdClass();
foreach ($array as $key => $value) {
$object->$key = $value;
}
diff --git a/includes/file.inc b/includes/file.inc
index a8f447b76..1d4399f5d 100644
--- a/includes/file.inc
+++ b/includes/file.inc
@@ -442,6 +442,7 @@ function file_scan_directory($dir, $mask, $nomask = array('.', '..', 'CVS'), $ca
}
elseif (ereg($mask, $file)) {
$name = basename($file);
+ $files["$dir/$file"] = new stdClass();
$files["$dir/$file"]->filename = "$dir/$file";
$files["$dir/$file"]->name = substr($name, 0, strrpos($name, '.'));
if ($callback) {
diff --git a/includes/module.inc b/includes/module.inc
index 18c7dfb4c..62c2cbae9 100644
--- a/includes/module.inc
+++ b/includes/module.inc
@@ -238,9 +238,12 @@ function module_invoke_all($hook, $a1 = NULL, $a2 = NULL, $a3 = NULL, $a4 = NULL
$return = array();
foreach (module_list() as $module) {
$result = module_invoke($module, $hook, $a1, $a2, $a3, $a4);
- if (isset($result)) {
+ if (is_array($result)) {
$return = array_merge($return, $result);
}
+ else if (isset($result)) {
+ $return[] = $result;
+ }
}
return $return;