mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 11:50:30 +02:00
Bugtracker #4029 - don't send totally blank PMs
This commit is contained in:
@@ -65,6 +65,7 @@ define('LAN_PM_61', "No subject");
|
|||||||
define('LAN_PM_62', "File: [{FILENAME}] exceeds size limit - not attached");
|
define('LAN_PM_62', "File: [{FILENAME}] exceeds size limit - not attached");
|
||||||
define('LAN_PM_63', "class:");
|
define('LAN_PM_63', "class:");
|
||||||
define('LAN_PM_64', 'ERROR: You are not permitted to block messages from site administrators');
|
define('LAN_PM_64', 'ERROR: You are not permitted to block messages from site administrators');
|
||||||
|
define('LAN_PM_65', 'ERROR: Nothing to send');
|
||||||
|
|
||||||
define("LAN_PM_100", "New PM from ");
|
define("LAN_PM_100", "New PM from ");
|
||||||
define("LAN_PM_101", "You have received a new Private Message from ");
|
define("LAN_PM_101", "You have received a new Private Message from ");
|
||||||
|
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/pm/pm_class.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/pm/pm_class.php,v $
|
||||||
| $Revision: 1.3 $
|
| $Revision: 1.4 $
|
||||||
| $Date: 2007-05-05 20:06:47 $
|
| $Date: 2007-08-02 20:41:30 $
|
||||||
| $Author: e107steved $
|
| $Author: e107steved $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -56,6 +56,8 @@ class private_message
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Send a PM
|
||||||
function add($vars)
|
function add($vars)
|
||||||
{
|
{
|
||||||
global $pm_prefs, $tp, $sql;
|
global $pm_prefs, $tp, $sql;
|
||||||
@@ -68,7 +70,7 @@ class private_message
|
|||||||
{
|
{
|
||||||
foreach($vars['uploaded'] as $u)
|
foreach($vars['uploaded'] as $u)
|
||||||
{
|
{
|
||||||
if(!isset($u['error']))
|
if (!isset($u['error']) || !$u['error'])
|
||||||
{
|
{
|
||||||
$pmsize += $u['size'];
|
$pmsize += $u['size'];
|
||||||
$a_list[] = $u['name'];
|
$a_list[] = $u['name'];
|
||||||
@@ -78,8 +80,14 @@ class private_message
|
|||||||
}
|
}
|
||||||
$pmsize += strlen($vars['pm_message']);
|
$pmsize += strlen($vars['pm_message']);
|
||||||
|
|
||||||
$pm_subject = $tp->toDB($vars['pm_subject']);
|
$pm_subject = trim($tp->toDB($vars['pm_subject']));
|
||||||
$pm_message = $tp->toDB($vars['pm_message']);
|
$pm_message = trim($tp->toDB($vars['pm_message']));
|
||||||
|
|
||||||
|
if (!$pm_subject && !$pm_message && !$attachlist)
|
||||||
|
{ // Error - no subject, no message body and no uploaded files
|
||||||
|
return LAN_PM_65;
|
||||||
|
}
|
||||||
|
|
||||||
$sendtime = time();
|
$sendtime = time();
|
||||||
if(isset($vars['to_userclass']) || isset($vars['to_array']))
|
if(isset($vars['to_userclass']) || isset($vars['to_array']))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user