Commit 640128b0 authored by Dries's avatar Dries

- Added some isset()s to kill some "Undefined variable" warnings.  Patch by
  Julio.
parent a4b13976
...@@ -115,7 +115,7 @@ function request_uri() { ...@@ -115,7 +115,7 @@ function request_uri() {
global $REQUEST_URI, $PATH_INFO, $QUERY_STRING; global $REQUEST_URI, $PATH_INFO, $QUERY_STRING;
if ($REQUEST_URI) { if (isset($REQUEST_URI)) {
return $REQUEST_URI; return $REQUEST_URI;
} }
else { else {
...@@ -211,7 +211,7 @@ function table_cell($cell, $header = 0) { ...@@ -211,7 +211,7 @@ function table_cell($cell, $header = 0) {
$data = $cell; $data = $cell;
} }
if ($header) { if (isset($header)) {
$output = "<th$attributes>$data</th>"; $output = "<th$attributes>$data</th>";
} }
else { else {
...@@ -341,7 +341,7 @@ function search_data() { ...@@ -341,7 +341,7 @@ function search_data() {
$keys = check_input($keys); $keys = check_input($keys);
if ($keys) { if (isset($keys)) {
foreach (module_list() as $name) { foreach (module_list() as $name) {
if (module_hook($name, "search") && (!$edit["type"] || $edit["type"][$name]) && ($result = module_invoke($name, "search", check_query($keys)))) { if (module_hook($name, "search") && (!$edit["type"] || $edit["type"][$name]) && ($result = module_invoke($name, "search", check_query($keys)))) {
if ($name == "node" || $name == "comment") { if ($name == "node" || $name == "comment") {
...@@ -376,7 +376,7 @@ function search_data() { ...@@ -376,7 +376,7 @@ function search_data() {
function search_type($type = 0, $action = 0, $query = 0, $options = 0) { function search_type($type = 0, $action = 0, $query = 0, $options = 0) {
global $edit; global $edit;
if ($type) { if (isset($type)) {
$edit["type"][$type] = "on"; $edit["type"][$type] = "on";
} }
...@@ -472,7 +472,7 @@ function filter($text) { ...@@ -472,7 +472,7 @@ function filter($text) {
} }
function check_output($text) { function check_output($text) {
if ($text) { if (isset($text)) {
$text = stripslashes($text); $text = stripslashes($text);
if (strip_tags($text, "<a><i><b><u><tt><code><cite><strong><img>") == $text) { if (strip_tags($text, "<a><i><b><u><tt><code><cite><strong><img>") == $text) {
...@@ -721,8 +721,8 @@ function form_weight($title = NULL, $name = "weight", $value = 0, $delta = 10, $ ...@@ -721,8 +721,8 @@ function form_weight($title = NULL, $name = "weight", $value = 0, $delta = 10, $
function url($url, $query = NULL) { function url($url, $query = NULL) {
if ($url) { if (isset($url)) {
if ($query) { if (isset($query)) {
return "?q=$url&$query"; return "?q=$url&$query";
} }
else { else {
...@@ -730,7 +730,7 @@ function url($url, $query = NULL) { ...@@ -730,7 +730,7 @@ function url($url, $query = NULL) {
} }
} }
else { else {
if ($query) { if (isset($query)) {
return "?$query"; return "?$query";
} }
} }
...@@ -753,7 +753,7 @@ function field_get($string, $name) { ...@@ -753,7 +753,7 @@ function field_get($string, $name) {
function field_set($string, $name, $value) { function field_set($string, $name, $value) {
$rval = ereg_replace(",$name=[^,]+", "", ",$string"); $rval = ereg_replace(",$name=[^,]+", "", ",$string");
if ($value) { if (isset($value)) {
$rval .= ($rval == "," ? "" : ",") ."$name=$value"; $rval .= ($rval == "," ? "" : ",") ."$name=$value";
} }
return substr($rval, 1); return substr($rval, 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment