|
From: Benjamin C. <bc...@us...> - 2001-11-19 16:49:23
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv8327
Modified Files:
bug.php include.php newaccount.php
Log Message:
Code cleanup
Index: bug.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/bug.php,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- bug.php 2001/11/14 14:28:06 1.61
+++ bug.php 2001/11/19 16:49:20 1.62
@@ -427,23 +427,26 @@
'TITLE' => $TITLE['enterbug'],
'error' => $error,
'bugid' => $bugid,
- 'title' => stripslashes($title),
- 'description' => stripslashes($description),
- 'url' => $url ? $url : 'http://',
- 'urllabel' => $url ? "<a href='$url'>URL</a>" : 'URL',
- 'severity' => build_select('severity',$severity),
- 'priority' => build_select('priority',$priority),
- 'status' => build_select('status',$status),
- 'resolution' => build_select('resolution',$resolution),
- 'assignedto' => $assignedto,
- 'createdby' => $createdby,
- 'createddate' => $createddate,
- 'lastmodifieddate' => $lastmodifieddate,
+ 'title' => isset($title) ? stripslashes($title) : '',
+ 'description' => isset($description) ? stripslashes($description) : '',
+ 'url' => isset($url) ? $url : 'http://',
+ 'urllabel' => isset($url) ? "<a href='$url'>URL</a>" : 'URL',
+ 'severity' => build_select('severity',(isset($severity) ? $severity : 0)),
+ 'priority' => build_select('priority',(isset($priority) ? $priority : 0)),
+ 'status' => build_select('status',(isset($status) ? $status : 0)),
+ 'resolution' => build_select('resolution',
+ (isset($resolution) ? $resolution : 0)),
+ 'assignedto' => isset($assignedto) ? $assignedto : '',
+ 'createdby' => isset($createdby),
+ 'createddate' => isset($createddate),
+ 'lastmodifieddate' => isset($lastmodifieddate),
'project' => $project,
'projectname' => $projectname,
- 'version' => build_select('version',$version,$project),
- 'component' => build_select('component',$component,$project),
- 'os' => build_select('os',$os)));
+ 'version' => build_select('version',
+ (isset($version) ? $version : 0),$project),
+ 'component' => build_select('component',
+ (isset($component) ? $component : 0),$project),
+ 'os' => build_select('os',(isset($os) ? $os : 0))));
}
}
@@ -586,7 +589,8 @@
$t->set_block('content','attrow','attrows');
$t->set_unknowns('remove');
- list($prevlink, $nextlink) = prev_next_links($bugid, $_gv['pos']);
+ list($prevlink, $nextlink) = prev_next_links($bugid,
+ isset($_gv['pos']) ? $_gv['pos'] : 0);
$t->set_var(array(
'statuserr' => isset($error['status']) ? $error['status'].'<br><br>' : '',
'bugid' => $bugid,
@@ -599,7 +603,7 @@
'priority' => build_select('priority',$row['priority']),
'status' => $row['status_name'],
'resolution' => !empty($row['resolution_name']) ? $row['resolution_name'] : '',
- 'owner' => maskemail($row['owner']),
+ 'owner' => isset($row['owner']) ? maskemail($row['owner']) : '',
'reporter' => maskemail($row['reporter']),
'createddate' => date(DATE_FORMAT,$row['created_date']),
'createdtime' => date(TIME_FORMAT,$row['created_date']),
@@ -618,7 +622,7 @@
'prevlink' => $prevlink,
'nextlink' => $nextlink,
'prevnextsep' => $prevlink && $nextlink ? ' | ' : '',
- 'pos' => $_gv['pos']
+ 'pos' => isset($_gv['pos']) ? $_gv['pos'] : 0
));
switch($row['status_name']) {
case 'Unconfirmed' :
@@ -705,7 +709,7 @@
}
function show_projects() {
- global $me, $q, $t, $project, $STRING;
+ global $me, $q, $t, $project, $STRING, $TITLE;
// Show only active projects with at least one component
$q->query('select p.project_id, p.project_name, p.project_desc, p.created_date
@@ -747,7 +751,7 @@
case 'history' : show_history($bugid); break;
case 'add' :
$perm->check('Editbug');
- if ($project) show_form();
+ if (isset($_gv['project'])) show_form();
else show_projects();
break;
case 'show' : show_bug($bugid); break;
Index: include.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/include.php,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -r1.76 -r1.77
--- include.php 2001/11/14 14:28:06 1.76
+++ include.php 2001/11/19 16:49:20 1.77
@@ -271,7 +271,7 @@
case 'os' :
$q->query("select {$box}_id, {$box}_name, regex from ".TBL_OS." order by sort_order");
while ($row = $q->grab()) {
- if ($value == '' and $row['Regex'] and
+ if ($value == '' and isset($row['Regex']) and
preg_match($row['Regex'],$GLOBALS['HTTP_USER_AGENT'])) $sel = ' selected';
elseif ($value == $row[$box.'_id']) $sel = ' selected';
else $sel = '';
Index: newaccount.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/newaccount.php,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- newaccount.php 2001/11/13 03:53:04 1.21
+++ newaccount.php 2001/11/19 16:49:20 1.22
@@ -77,10 +77,12 @@
$t->set_block('content', 'loginentryarea', 'loginarea');
$t->set_var(array(
'error' => $error,
- 'login' => stripslashes($_pv['login']),
- 'email' => $_pv['email'],
- 'firstname' => stripslashes($_pv['firstname']),
- 'lastname' => stripslashes($_pv['lastname'])
+ 'login' => isset($_pv['login']) ? stripslashes($_pv['login']) : '',
+ 'email' => isset($_pv['email']) ? $_pv['email'] : '',
+ 'firstname' => isset($_pv['firstname']) ? stripslashes($_pv['firstname'])
+ : '',
+ 'lastname' => isset($_pv['lastname']) ? stripslashes($_pv['lastname'])
+ : ''
));
// Show the login field if necessary
@@ -94,7 +96,7 @@
$t->set_file('wrap','wrap.html');
$t->set_var('TITLE',$TITLE['newaccount']);
-if ($_pv['createaccount']) do_form();
+if (isset($_pv['createaccount'])) do_form();
else show_form();
$t->pparse('main',array('content','wrap','main'));
|