diff MoinMoin/items/__init__.py @ 170:1481cbc12553

metadata: only store hostname if we did a successful lookup if lookup fails or is disallowed, do not store fake data. get_hostname: simplify, return None if it is disallowed or fails
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Wed, 06 Apr 2011 02:52:21 +0200
parents 7926fa38e797
children 89f50aed143f
line wrap: on
line diff
--- a/MoinMoin/items/__init__.py	Wed Apr 06 01:50:42 2011 +0200
+++ b/MoinMoin/items/__init__.py	Wed Apr 06 02:52:21 2011 +0200
@@ -446,8 +446,9 @@
         if remote_addr:
             if app.cfg.log_remote_addr:
                 newrev[ADDRESS] = unicode(remote_addr)
-                if app.cfg.log_reverse_dns_lookups:
-                    newrev[HOSTNAME] = unicode(wikiutil.get_hostname(remote_addr))
+                hostname = wikiutil.get_hostname(remote_addr)
+                if hostname:
+                    newrev[HOSTNAME] = hostname
         if flaskg.user.valid:
             newrev[USERID] = unicode(flaskg.user.id)