Welcome to Geeklog, Anonymous Tuesday, November 26 2024 @ 04:47 am EST

Geeklog Forums

my plugin (comments) broke after upgrade


Status: offline

amckay

Forum User
Full Member
Registered: 03/23/02
Posts: 180
Hey folks,

I just (finally) upgrade to the latest 1.3.8 from 1.3.7, and my plugins do not work quite right. When you view comments it only shows the comment title but not the body. When you hit "refresh" is switches from /myplugin/index.php?myView to /article.php and displays correctly.

Checking my code, I call : COM_userComments and this seems to be where it is broken.

Pointers?
 Quote

Status: offline

amckay

Forum User
Full Member
Registered: 03/23/02
Posts: 180
Hmmm, and it only seems to be one of my plugins. The other seems to be just fine ...
 Quote

Status: offline

amckay

Forum User
Full Member
Registered: 03/23/02
Posts: 180
Is it normal for COM_comment to have 2 parameters both called "mode"?

Anyway, in lib-common.php at line 2902 I insert a debugging statement to echo A['comment'] and it is indeed empty before hitting 'refresh' and set afterwards.

Strange...
 Quote

Status: offline

amckay

Forum User
Full Member
Registered: 03/23/02
Posts: 180
Looks like the preg_replace in COM_comment is wiping out my comment. The first echo here before that code segment echos the comment, while the echo statement just below it is empty.

Text Formatted Code

echo "[" . $A['comment'] . "]";
        if( !empty( $query ))
        {
            $mywords = explode( ' ', $query );
            foreach( $mywords as $searchword )
            {
                $A['comment'] = preg_replace( "/(>(((?>[^><]+)|(?R))*)<)/ie", "preg_replace('/(?>$searc
hword+)/i','<span class="highlight">$searchword</span>','')", "<x>" . $A['comment'] . "<x>" );
            }
        }

echo "[" . $A['comment'] . "]";

 
 Quote

All times are EST. The time is now 04:47 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content