summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tänzer <neo@nhng.de>2014-04-07 15:16:23 +0200
committerMichael Tänzer <neo@nhng.de>2014-04-07 15:16:23 +0200
commit72e84079e729ceddc9886bfaa7f113fbaaab4646 (patch)
treeb92d5745b768cfd3ea7181e5e5bc43036d442fd9
parent8654cbfb0e6eed0dda52379d9bfd971c3e254b74 (diff)
downloadcacert-devel-72e84079e729ceddc9886bfaa7f113fbaaab4646.tar.gz
cacert-devel-72e84079e729ceddc9886bfaa7f113fbaaab4646.tar.xz
cacert-devel-72e84079e729ceddc9886bfaa7f113fbaaab4646.zip
bug 1138: Properly compare against datetime strings
Signed-off-by: Michael Tänzer <neo@nhng.de>
-rw-r--r--includes/notary.inc.php16
1 files changed, 9 insertions, 7 deletions
diff --git a/includes/notary.inc.php b/includes/notary.inc.php
index 1d8b5f0..5b6e7c2 100644
--- a/includes/notary.inc.php
+++ b/includes/notary.inc.php
@@ -16,6 +16,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+define('NULL_DATETIME', '0000-00-00 00:00:00');
+
function query_init ($query)
{
return mysql_query($query);
@@ -1479,10 +1481,10 @@ function output_log_email_header(){
function output_log_email($row,$primary){
$primaryemailaddress='';
$deletedemailaddress='';
- if ($row['deleted'] > 0) {
+ if ($row['deleted'] !== NULL_DATETIME) {
$deletedemailaddress=' deletedemailaddress';
}
- if ($primary==$row['email'] && $row['deleted'] == 0) {
+ if ($primary==$row['email'] && $row['deleted'] === NULL_DATETIME) {
$primaryemailaddress= ' primaryemailaddress';
}
?>
@@ -1518,14 +1520,14 @@ function output_log_domains_header(){
*/
function output_log_domains($row){
$italic='';
- if (0==$row['deleted']) {
- $italic='italic ';
+ if ($row['deleted'] !== NULL_DATETIME) {
+ $italic=' italic';
}
?>
<tr>
- <td class="DataTD <? $italic ?>"><?=$row['domain']?></td>
- <td class="DataTD <? $italic ?>"><?=$row['created']?></td>
- <td class="DataTD <? $italic ?>"><?=$row['deleted']?></td>
+ <td class="DataTD<? $italic ?>"><?=$row['domain']?></td>
+ <td class="DataTD<? $italic ?>"><?=$row['created']?></td>
+ <td class="DataTD<? $italic ?>"><?=$row['deleted']?></td>
</tr>
<?
}