Permalink
Browse files

Fix some errors with incorrectly typed values

  • Loading branch information...
kormoc committed Apr 7, 2013
1 parent f660af4 commit a73cb6455b6d65d676e40e486ed68b556b8f88bd
Showing with 32 additions and 7 deletions.
  1. +18 −0 includes/defaults.php
  2. +11 −7 includes/errordisplay.php
  3. +3 −0 includes/init.php
View
@@ -0,0 +1,18 @@
<?php
/**
* This file is part of MythWeb, a php-based interface for MythTV.
* See http://www.mythtv.org/ for details.
*
* Just a list of defaults for globals
*
* @license GPL
*
* @package MythWeb
*
/**/
global $headers;
$headers = array();
global $Footnotes;
$Footnotes = array();
View
@@ -53,7 +53,7 @@
function display_errors($leading='<p align="center">', $trailing = '</p>') {
global $Errors, $Warnings;
// Errors or warnings from a previous page?
if (@count($_SESSION['WARNINGS'])) {
if (is_array($_SESSION['WARNINGS']) && count($_SESSION['WARNINGS'])) {
foreach ($_SESSION['WARNINGS'] as $warning) {
$Warnings[] = $warning;
}
@@ -165,12 +165,16 @@ function warnings() {
function save_session_errors() {
global $Errors, $Warnings;
$_SESSION['WARNINGS'] = array();
foreach ($Errors as $error) {
$_SESSION['WARNINGS'][] = $error;
}
foreach ($Warnings as $warning) {
$_SESSION['WARNINGS'][] = $warning;
}
if (is_array($Errors)) {
foreach ($Errors as $error) {
$_SESSION['WARNINGS'][] = $error;
}
}
if (is_array($Warnings)) {
foreach ($Warnings as $warning) {
$_SESSION['WARNINGS'][] = $warning;
}
}
}
/**
View
@@ -72,3 +72,6 @@
// And do some quick setup...
MythBackend::find()->setTimezone();
// Set some default types
require_once 'includes/defaults.php';

0 comments on commit a73cb64

Please sign in to comment.