View Single Post
  #12  
Old 03-29-2017, 11:49 PM
ewe ewe is offline
Member
 
Join Date: Mar 2017
Posts: 8
Gender: Female
Credits: 1,883
ewe is on a distinguished road
Default

I was similarly irritated by reply not grabbing a title and I accidentally stumbled upon this. I felt the need to change one thing, though - a devious and clever user could theoretically go through message IDs and read things not meant for them.

PHP Code:
$message = new PrivateMessage
// CHANGES START HERE

$title "(no subject)"// this way it'll never be blank
if($mysidia->input->get("id")){ // if there's an get value
    
$where trim($mysidia->input->get("id")); // trim the value
     
if (!ctype_digit($where)) { // if its not numeric only
        
$user $where// create a message to this user
    
} else if (ctype_digit($where)){ // if it IS numeric only then it's a reply, so pull data        
        
$oldMessage = new PrivateMessage($where); 
        
//my little paranoid change is here: 
        
if($mysidia->user->username == $oldMessage->fromuser) {     
          
$js "<script>$('.content h2').text('Reply To Message');</script>"// optional
          
$user $oldMessage->fromuser;     
          
$title "RE: ".$oldMessage->messagetitle;    
          
$msg "› {$user} wrote: ".$oldMessage->messagetext;
        }
    }
}

// CHANGES END HERE
$editor $message->getEditor(); 
Reply With Quote