Ref link fixed, nickname fixed, several rewrites, TODOs.txt updated:
[mailer.git] / inc / filters.php
index a0988c9539578bc6251ec4bf6600827225cf2dcc..b1784834747acc3e5cd82a9be03b740917f589c8 100644 (file)
@@ -307,7 +307,7 @@ function FILTER_FLUSH_FILTERS () {
                                // Add this filter (all filters are active by default)
                                $insertSQL .= sprintf("('%s','%s','Y'),", $filterName, $filterFunction);
                                $inserted++;
-                       } elseif ($active == "R") {
+                       } elseif ($active == 'R') {
                                // Remove this filter
                                $removeSQL .= sprintf(" (`filter_name`='%s' AND `filter_function`='%s') OR", $filterName, $filterFunction);
                                $removed++;
@@ -327,7 +327,7 @@ function FILTER_FLUSH_FILTERS () {
        // Something has been removed?
        if ($removed > 0) {
                // Finish SQL command
-               $removeSQL = substr($removeSQL, 0, -2) . "LIMIT ".$removed;
+               $removeSQL = substr($removeSQL, 0, -2) . 'LIMIT '.$removed;
 
                // And run it
                ADD_SQL($removeSQL);
@@ -359,7 +359,7 @@ function FILTER_CALL_HANDLER_LOGIN_FAILTURES ($data) {
        $content = $data;
 
        // Handle failed logins here if not in guest
-       //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):type={$data['type']},action={getAction()},what={getWhat()},lvl={$data['access_level']}<br />\n";
+       //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):type={$data['type']},action={getAction()},what={getWhat()},lvl={$data['access_level']}<br />");
        if ((($data['type'] == 'what') || ($data['type'] == 'action') && ((!isWhatSet()) || (getWhat() == 'overview') || (getWhat() == getConfig('index_home')))) && ($data['access_level'] != 'guest') && ((GET_EXT_VERSION('sql_patches') >= '0.4.7') || (GET_EXT_VERSION('admins') >= '0.7.0'))) {
                // Handle failure
                $content['content'] .= HANDLE_LOGIN_FAILTURES($data['access_level']);
@@ -389,7 +389,7 @@ function FILTER_AUTO_ACTIVATE_EXTENSION ($data) {
        // Is this extension always activated?
        if (EXT_GET_ALWAYS_ACTIVE() == 'Y') {
                // Then activate the extension
-               //* DEBUG: */ echo __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ext_name={$data['ext_name']}<br />\n";
+               //* DEBUG: */ OUTPUT_HTML(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): ext_name={$data['ext_name']}<br />");
                ACTIVATE_EXTENSION($data['ext_name']);
        } // END - if
 
@@ -591,8 +591,10 @@ function FILTER_DETERMINE_USERNAME () {
                        array(getUserId()), __FILE__, __LINE__);
                if (SQL_NUMROWS($result) == 1) {
                        // Load surname and family's name and build the username
-                       list($s, $f) = SQL_FETCHROW($result);
-                       $username = $s . ' ' . $f;
+                       $content = SQL_FETCHARRAY($result);
+
+                       // Prepare username
+                       $username = $content['surname'] . ' ' . $content['family'];
 
                        // Additionally admin?
                        if (IS_ADMIN()) {