From 78def0485b8acc2e4297b2d60e70c0fb7e8f109f Mon Sep 17 00:00:00 2001 From: natrak <> Date: Mon, 23 Apr 2001 11:06:17 +0000 Subject: [PATCH] Changes - Fixed an error in module_rehash_blocks() that didn't handle '-symbols. - Removed some module depencies. Drupal will now run (sorta) even if there are no modules installed. - Changed theme_link() to check if certain modules are installed before offering a link to them. Todo - Check all SQL queries to make sure they are addslashes'ed correctly. - Check the effects of changing the PHP magic_quotes setting. - Make the theme_link() function to be customizable either via the admin page and/or in the module itself. --- includes/locale.inc | 2 +- includes/node.inc | 2 +- modules/box.module | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/includes/locale.inc b/includes/locale.inc index 4fd927c5607..8f4622a3f61 100644 --- a/includes/locale.inc +++ b/includes/locale.inc @@ -7,7 +7,7 @@ function locale_init() { function t($string) { global $languages; - return ($languages ? locale($string) : $string); + return ($languages && function_exists("locale") ? locale($string) : $string); } ?> \ No newline at end of file diff --git a/includes/node.inc b/includes/node.inc index 37e46f0b5f6..374732ae689 100644 --- a/includes/node.inc +++ b/includes/node.inc @@ -147,7 +147,7 @@ function node_save($node) { function node_invoke($node, $name, $arg = 0) { if ($node[type]) $function = $node[type] ."_$name"; if ($node->type) $function = $node->type ."_$name"; - if ($function) return ($arg ? $function($node, $arg) : $function($node)); + if (function_exists($function)) return ($arg ? $function($node, $arg) : $function($node)); } function node_view($node, $main = 0) { diff --git a/modules/box.module b/modules/box.module index bfd8b3d3cac..789185cc52e 100644 --- a/modules/box.module +++ b/modules/box.module @@ -35,7 +35,7 @@ function box_help() { } function box_block() { - $result = db_query("SELECT * FROM boxes"); + $result = db_query("SELECT * FROM boxes ORDER BY subject"); $i = 0; while ($block = db_fetch_object($result)) { $blocks[$i]["subject"] = check_output($block->subject); @@ -44,7 +44,6 @@ function box_block() { $blocks[$i]["link"] = check_output($block->link); $i++; } - return $blocks; }