]> git.mxchange.org Git - mailer.git/blobdiff - inc/mysql-manager.php
Fix for 'empty version' and eval-ed the email again
[mailer.git] / inc / mysql-manager.php
index cc9b9aedcab6bec531ef0606903b2ee46d9cbb70..bc2ccddadf095d4718a0f10feb9815586c4324f9 100644 (file)
@@ -1733,7 +1733,7 @@ WHERE
                SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `userid`=%s", array(bigintval($userid)), __FUNCTION__, __LINE__);
 
                // Update mediadata as well
-               if (getExtensionVersion('mediadata') >= '0.0.4') {
+               if (isExtensionInstalledAndNewer('mediadata', '0.0.4')) {
                        // Update database
                        updateMediadataEntry(array('total_points'), 'sub', $points);
                } // END - if
@@ -1869,7 +1869,10 @@ function generateCategoryOptionsList ($mode) {
        );
 
        // Get categories
-       $result = SQL_QUERY("SELECT id, cat FROM `{?_MYSQL_PREFIX?}_cats`".$whereStatement." ORDER BY `sort`", __FUNCTION__, __LINE__);
+       $result = SQL_QUERY("SELECT `id`, `cat` FROM `{?_MYSQL_PREFIX?}_cats`".$whereStatement." ORDER BY `sort` ASC",
+               __FUNCTION__, __LINE__);
+
+       // Do we have entries?
        if (SQL_NUMROWS($result) > 0) {
                // ... and begin loading stuff
                while ($content = SQL_FETCHARRAY($result)) {
@@ -1890,7 +1893,9 @@ function generateCategoryOptionsList ($mode) {
 FROM
        `{?_MYSQL_PREFIX?}_user_data`
 WHERE
-       `userid`=%s AND `status`='CONFIRMED' AND `receive_mails` > 0".runFilterChain('exclude_users', $mode)."
+       `userid`=%s AND
+       `status`='CONFIRMED' AND
+       `receive_mails` > 0".runFilterChain('exclude_users', $mode)."
 LIMIT 1",
                                        array(bigintval($ucat)), __FUNCTION__, __LINE__);
 
@@ -2222,7 +2227,7 @@ function reduceRecipientReceivedMails ($column, $id, $count) {
 function createNewTask ($subject, $notes, $taskType, $userid = '0', $adminId = '0', $strip = true) {
        // Insert the task data into the database
        SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_task_system` (`assigned_admin`, `userid`, `status`, `task_type`, `subject`, `text`, `task_created`) VALUES (%s,%s,'NEW','%s','%s','%s', UNIX_TIMESTAMP())",
-               array($adminId, $userid, $taskType, $subject, addslashes($notes)), __FUNCTION__, __LINE__, true, $strip);
+               array($adminId, $userid, $taskType, $subject, escapeQuotes($notes)), __FUNCTION__, __LINE__, true, $strip);
 }
 
 // Updates last module / online time