[pLog-svn] r7018 - plugins/branches/lifetype-1.2/editcomments

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Wed Aug 4 22:21:18 EDT 2010


Author: jondaley
Date: 2010-08-04 22:21:18 -0400 (Wed, 04 Aug 2010)
New Revision: 7018

Modified:
   plugins/branches/lifetype-1.2/editcomments/plugineditcomments.class.php
Log:
need a fix for my original hack for parsing the template once the CSRF plugin is added

Modified: plugins/branches/lifetype-1.2/editcomments/plugineditcomments.class.php
===================================================================
--- plugins/branches/lifetype-1.2/editcomments/plugineditcomments.class.php	2010-08-05 02:20:49 UTC (rev 7017)
+++ plugins/branches/lifetype-1.2/editcomments/plugineditcomments.class.php	2010-08-05 02:21:18 UTC (rev 7018)
@@ -10,7 +10,7 @@
 			$this->desc = "Allows editing of comments for users with the 'update existing comments' permission.";
 			$this->author = "Jon Daley";
 			$this->locales = Array( "en_UK" );
-            $this->version = "20071119";
+            $this->version = "20100804";
             
 			if($source == "admin")
                 $this->initAdmin();
@@ -46,7 +46,7 @@
 
                 // load the current contents of the template
             $content = $params["content"];
-            $regexp = "/<div class=\"list_action_button\">.*?<\/div>/s";
+            $regexp = "/<div class=\"list_action_button\">(.*?)<\/div>/s";
             preg_match_all($regexp, $content, $matches, PREG_SET_ORDER);
 
                 // now process each one of the matches and do the replacements
@@ -54,14 +54,14 @@
                 if($action == "editTrackback"){
                         // fetch the trackback id
                     $res = preg_match(
-                        "/<a href=\"\?op=deleteTrackback&amp;articleId=[0-9]+&amp;trackbackId=([0-9]+)\"/i",
-                        $match[0], $result);
+                        "/<a href=\"\?op=deleteTrackback&amp;.*&amp;trackbackId=([0-9]+?)\"/iU",
+                        $match[1], $result);
                 }
                 else if($action == "editComment"){
                         // fetch the comment id
                     $res = preg_match(
-                        "/<a href=\"\?op=deleteComment&amp;commentId=([0-9]+)&amp;/i",
-                        $match[0], $result);
+                        "/<a href=\"\?op=deleteComment&amp;.*commentId=([0-9]+?)/iU",
+                        $match[1], $result);
                 }
                 
                 if($res){



More information about the pLog-svn mailing list