Advertisement:

Author Topic: Bad Behavior for SMF mod  (Read 334480 times)

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 59,346
  • Gender: Male
    • Kindred-999 on GitHub
right... and, as expected from the original error - the problem is not in this mod... it's with whatever mod is called "googletagged". So, your best bet it to bring it up in that mod's support thread. :)
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Blade_Runner

  • Jr. Member
  • **
  • Posts: 247
right... and, as expected from the original error - the problem is not in this mod... it's with whatever mod is called "googletagged". So, your best bet it to bring it up in that mod's support thread. :)

Thank you for your reply. I will bring it up to the correct thread.

Offline awolexpat

  • Jr. Member
  • **
  • Posts: 129
butchs,
I think I spoke too soon - my error had started appearing again, just that I didn't see it.  Exactly the same as before, same line too. To be on the safe side I had reuploaded the replacement file you gave me and then cleared the file cache and the Cloudflare one. The only thing I didn't do was the server cache because I don't have server caching turned on in my SMF. Does anyone have any further suggestions?
To save you looking back in the thread the error is:
Quote
http://www.awolonline.net/forum/index.php?action=register2
8: Array to string conversion
File: /home3/awolonl1/public_html/forum/Sources/BadBehavior-mysql.php
Line: 220

and refers to this bit of code:
Code: [Select]
218: if (!strcasecmp($request_method, "POST")  && (!empty($package['request_entity']))) {
219: foreach ($package['request_entity'] as $h => $v) {
==>220: $request_entity .= $h . ": " .$v . "\n\r";
221: }

I also checked against the replacement file you gave me and this is the code on those lines. I also used a comparison program (DiffMerge) and I can see the changes you have made so I know that the revised file is the one being used.

Offline Jerri Blank

  • Semi-Newbie
  • *
  • Posts: 86
I installed this mod and had some trouble getting it working (non-standard theme, I think), so I have uninstalled it for now.

The problem is that all the pages of my forum have this at the top:

Code: [Select]
$txt['HPlocation'] = 'Project Honey Pot (all regions)';
Can someone tell me how to get rid of that?  Wasn't the uninstall supposed to reverse changes to PHP files?

Thanks!

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 59,346
  • Gender: Male
    • Kindred-999 on GitHub
try using search? This has been answered dozens of times...

What happened is that you installed a mod which added text strings to your modifications.english.php file AFTER the closing ?> in the php file.
(not this one, mind you, this one does it correctly, so some other mod did the bad thing)

All you have to do is to find the ?> in that file and move it to the very end of the file
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Jerri Blank

  • Semi-Newbie
  • *
  • Posts: 86
Thanks for the info.

By the by, I tried searching the forum AND using a Google site search, using all or part of this stray string as my search term.  No luck either way.  I'm not a noob.

Offline butchs

  • SMF Hero
  • ******
  • Posts: 1,733
  • Lost 7GB bandwidth!
    • EastCoastRollingThunder
I also checked against the replacement file you gave me and this is the code on those lines. I also used a comparison program (DiffMerge) and I can see the changes you have made so I know that the revised file is the one being used.


Since it is unlikely the key is an array the $v must be the array?  This should not happen since the core converts the array into a string.  Could be a new php version bug in the core or a new bot trick?  I have no plans to edit the core unless there is a gun to my head so try this...

Change...
Code: [Select]
$request_entity .= $h . ": " .$v . "\n\r";
To:
Code: [Select]
if (is_array($v)) break;
$request_entity .= $h . ": " .$v . "\n\r";

Then reset your claoudflare cache.
I have been truly inspired by the SUGGESTIONS as I sit on my throne and contemplate the wisdom imposed upon me.

Offline awolexpat

  • Jr. Member
  • **
  • Posts: 129
It's a couple of days now and no reappearance of the error so that seems to have finally fixed it - thank you once again!

Offline Chalky

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,380
  • Gender: Female
  • If in doubt, give me beer...
    • ChalkCat
I have searched the topic but can't find the answer.  I have BB version 1.5.11 installed and want to update to the latest version.  What's the best way to update?  Should I uninstall the previous version first then install the latest version afresh?  I'm nervous because I had to make a lot of manual edits to install this mod in the first place.

Offline NanoSector

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,500
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Try uninstalling. If you see a checkbox saying delete data associated, leave it unchecked (should keep the settings). If not, note down any settings or take a screenshot (Evernote and LightShot ftw?).
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline butchs

  • SMF Hero
  • ******
  • Posts: 1,733
  • Lost 7GB bandwidth!
    • EastCoastRollingThunder
UPGRADING FROM AN OLDER VERSION HELP

I have searched the topic but can't find the answer.  I have BB version 1.5.11 installed and want to update to the latest version.  What's the best way to update?  Should I uninstall the previous version first then install the latest version afresh?  I'm nervous because I had to make a lot of manual edits to install this mod in the first place.

Try uninstalling. If you see a checkbox saying delete data associated, leave it unchecked (should keep the settings). If not, note down any settings or take a screenshot (Evernote and LightShot ftw?).

That is correct. :)

For versions  1.5.9 and older it is recommended to print the "whitelist.ini" file in the bad "Sources/bad-behavior" folder and transfer the data to the Mod's admin page.  Versions 1.5.10 and newer store the associated data for the settings in the forums database.  The ini files are no longer required.
I have been truly inspired by the SUGGESTIONS as I sit on my throne and contemplate the wisdom imposed upon me.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 59,346
  • Gender: Male
    • Kindred-999 on GitHub
Unless core SMF code is further changed (and most of these updated just change the BB code in the BB specific files), what I usually do is just replace the mod specific files in the sources, sources subdirectory and the template files in the themes/default directory
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Chalky

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,380
  • Gender: Female
  • If in doubt, give me beer...
    • ChalkCat
Cool, thanks guys, I'll give it a go  :)

Offline meylodie

  • Semi-Newbie
  • *
  • Posts: 75
Re: Bad Behavior mod - The Web's premier link spam killer (Now with SMF 2 httpBL)
« Reply #753 on: February 14, 2013, 06:48:23 PM »
Hello,

I am running SMF 2.0.4 and installed Bad Behavior a few days ago. It has prevented 11 attacks in 7 days, according to the stats. I have been browsing the admin entries related to it and while doing that I have been invited to see the latest available version on the Bad behavior main site:
http://bad-behavior.ioerror.us/2012/12/10/bad-behavior-2-2-13

Quote
Bad Behavior 2.2.13 has been released. This is a maintenance release and is recommended for all users.

Quote
Changes
The following changes have been made since 2.2.12:

    Requests from the Baidu search engine now go through screening similar to Google and other major search engines. This will help to prevent illegitimate access from clients which falsely claim to be the Baidu search engine. A logic error which prevented these checks from ever running has been fixed.

The version of the MOD has for number 1.1.15 : wouldn't it be good to get an update for it ?

Thank you,
Mélodie



Offline butchs

  • SMF Hero
  • ******
  • Posts: 1,733
  • Lost 7GB bandwidth!
    • EastCoastRollingThunder
Re: Bad Behavior mod - The Web's premier link spam killer (Now with SMF 2 httpBL)
« Reply #754 on: February 14, 2013, 07:20:59 PM »
If you look at the mod page.  You will find that as of  December 13, 2012 Bad Behavior for SMF mod version 1.5.15 includes Bad Behavior core version 2.2.13 plus all that wonderful stuff, and then some, I programmed to make it work on SMF.  You can verify the core version by looking at the ABOUT menu in the Bad Behavior Admin section in your forum.
 :)
I have been truly inspired by the SUGGESTIONS as I sit on my throne and contemplate the wisdom imposed upon me.

Offline meylodie

  • Semi-Newbie
  • *
  • Posts: 75
Re: Bad Behavior mod - The Web's premier link spam killer (Now with SMF 2 httpBL)
« Reply #755 on: February 14, 2013, 07:58:08 PM »
Oh yes! I feel very bad suddenly...  ???

Thank you very much for your so fast response. :)


Offline RustyBarnacle

  • Sr. Member
  • ****
  • Posts: 722
    • Saving Tallingroth
Re: Bad Behavior mod - The Web's premier link spam killer (Now with SMF 2 httpBL)
« Reply #756 on: February 28, 2013, 06:20:05 PM »
I have a random white bar appear at the top of my page and another user helped me notice that it usually happens when I have this at the top of my page:

removed.

Do you know why that might be?
« Last Edit: February 28, 2013, 10:14:19 PM by RustyBarnacle »

Offline butchs

  • SMF Hero
  • ******
  • Posts: 1,733
  • Lost 7GB bandwidth!
    • EastCoastRollingThunder
Re: Bad Behavior mod - The Web's premier link spam killer (Now with SMF 2 httpBL)
« Reply #757 on: February 28, 2013, 07:32:12 PM »
Those are among the 20 different automatic random "Google safe" scattered honeypot spam traps.  A spam bot will click on them to get a free listing at project honeypot.
 
Select "Limit honeypot on forum" for less dramatic honeypots.

Oh yea, you shouldn't post the link to your honeypot spam trap.  Please edit your last post.
I have been truly inspired by the SUGGESTIONS as I sit on my throne and contemplate the wisdom imposed upon me.

Offline RustyBarnacle

  • Sr. Member
  • ****
  • Posts: 722
    • Saving Tallingroth
I think I've got it.  It only happens during case5

case 5:
         return '<a href="'. $modSettings['badbehavior_httpbl_link'] .'">&#020</a>';

So I replaced it with the same code that was under case 6 and I believe the problem has gone away.

This is why it was so random.

Offline butchs

  • SMF Hero
  • ******
  • Posts: 1,733
  • Lost 7GB bandwidth!
    • EastCoastRollingThunder
Which browser were you using when you noticed it?
I have been truly inspired by the SUGGESTIONS as I sit on my throne and contemplate the wisdom imposed upon me.