[geeklog-cvs] geeklog: Some minor corrections for the new [user:] autotag

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Thu Mar 18 13:24:34 EDT 2010


changeset 7808:7aae19e54b3c
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/7aae19e54b3c
user: Dirk Haun <dirk at haun-online.de>
date: Thu Mar 18 17:59:56 2010 +0100
description:
Some minor corrections for the new [user:] autotag

diffstat:

 system/lib-plugins.php |  19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diffs (31 lines):

diff -r e0bb8af6438f -r 7aae19e54b3c system/lib-plugins.php
--- a/system/lib-plugins.php	Wed Mar 17 02:03:41 2010 +0700
+++ b/system/lib-plugins.php	Thu Mar 18 17:59:56 2010 +0100
@@ -1606,16 +1606,19 @@
                         }
                     }
                 }
-                
+
                 if ($autotag['tag'] == 'user') {
-                    $autotag['parm1'] = addslashes($autotag['parm1']);
+                    $autotag['parm1'] = COM_applyFilter($autotag['parm1']);
                     if (! empty($autotag['parm1'])) {
-                        $sql = "SELECT uid, fullname FROM {$_TABLES['users']} WHERE username = '{$autotag['parm1']}'";
-                        $result = DB_query( $sql );
-                        $A = DB_fetchArray( $result );
-                        $url = $_CONF['site_url'] . '/users.php?mode=profile&uid=' . $A['uid'];
-                        if (empty($linktext)) {
-                            $linktext = COM_getDisplayName( $A['uid'], $autotag['parm1'], $A['fullname'] );
+                        $uname = addslashes($autotag['parm1']);
+                        $sql = "SELECT uid, fullname FROM {$_TABLES['users']} WHERE username = '$uname'";
+                        $result = DB_query($sql);
+                        if (DB_numRows($result) == 1) {
+                            $A = DB_fetchArray($result);
+                            $url = $_CONF['site_url'] . '/users.php?mode=profile&uid=' . $A['uid'];
+                            if (empty($linktext)) {
+                                $linktext = COM_getDisplayName($A['uid'], $autotag['parm1'], $A['fullname']);
+                            }
                         }
                     }
                 }



More information about the geeklog-cvs mailing list