Permalink
Browse files

Fixed annoying undefined variable notices

  • Loading branch information...
1 parent bc7eeb4 commit ab64bba373b4ee766071ed6dc9b209ce92c549a9 @smajda committed Jul 21, 2009
Showing with 7 additions and 6 deletions.
  1. +3 −3 includes/access.php
  2. +3 −2 includes/todo.php
  3. +1 −1 index.php
View
6 includes/access.php
@@ -60,7 +60,7 @@ class="wide" type='text' name='input_user' /><br />
session_start();
-if(!$_SESSION['authenticated']) {
+if(!isset($_SESSION['authenticated'])) {
if (isset($_COOKIE['todotxt-user']) && isset($_COOKIE['todotxt-pass'])) {
@@ -71,7 +71,7 @@ class="wide" type='text' name='input_user' /><br />
displayform(1);
}
- } elseif($_POST['loginbutton']) {
+ } elseif(isset($_POST['loginbutton'])) {
if (($_POST['input_user'] == $user) && ($_POST['input_password'] == $password)) {
@@ -82,7 +82,7 @@ class="wide" type='text' name='input_user' /><br />
setcookie('todotxt-pass', md5($_POST['input_password']), $expire);
}
$_SESSION['authenticated'] = 1;
- header("Location:".$todoURL);
+ header("Location:".$todoUrl);
} else {
displayform(1);
View
5 includes/todo.php
@@ -2,11 +2,12 @@
// process $_POST
function get_cmd($_POST, $id='cmd') {
- if($cmd=$_POST[$id]) {
+ if(isset($_POST[$id]) && $cmd=$_POST[$id]) {
$cmd=rawurldecode($cmd);
$cmd=stripslashes($cmd);
}
- return $cmd;
+ if(isset($cmd))
+ return $cmd;
}
// checks if a command is an ls command or not
View
2 index.php
@@ -2,7 +2,7 @@
require_once('includes/config.php');
require_once('includes/access.php');
require_once('includes/todo.php');
-if($_GET['logout'] == 'true') {logout();}
+if(isset($_GET['logout'])) { $_GET['logout'] == 'true' ? logout() : '';}
$cmd = get_cmd($_POST);
$cmd2 = get_cmd($_POST, 'cmd2');
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN">

0 comments on commit ab64bba

Please sign in to comment.