Ticket #204: CommentModeration-patch-for-jlog1.1.3.diff

File CommentModeration-patch-for-jlog1.1.3.diff, 944 bytes (added by driehle, 3 years ago)
  • CommentModeration.jplug.php

     
    8989         */ 
    9090        function hook_adminMail($mail, $blogentry) { 
    9191                $trashURL = '/admin/comments.php?action=trash&id='; 
    92                 $matches = array(); 
    93  
    94                 if (($pos = strrpos($mail['text'], $trashURL)) !== FALSE) 
     92                $matches  = array(); 
     93        $text     = $mail->getText(); 
     94         
     95                if (($pos = strrpos($text, $trashURL)) !== FALSE) 
    9596                { 
    96                         $rest = substr($mail['text'], $pos); 
    97  
    98                         if (preg_match('/([0-9]+)/', $rest, $matches)) 
    99                                 $mail['text'] .= "\n\nKommentar genehmigen\n" . 
     97                        if (preg_match('/([0-9]+)/', $text, $matches, null, $pos)) 
     98                                $text .= "\n\nKommentar genehmigen\n" . 
    10099                                        JLOG_PATH . '/admin/plugin.php?jplug=CommentModeration&allow=' . 
    101100                                        $matches[0]; 
     101                        $mail->setText($text); 
    102102                } 
    103103 
    104104                return $mail;