Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4257
Latest: Alex998.
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43295
Total Topics: 7523
Most Online Today: 161
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 142
Total: 142

Author Topic: Ad Seller Pro breaks Remove Old Posts  (Read 4577 times)

0 Members and 1 Guest are viewing this topic.

Offline David8

  • Member
  • *
  • Posts: 18
    • View Profile
Ad Seller Pro breaks Remove Old Posts
« on: February 11, 2011, 11:23:03 am »
I am running an SMF 2.0 RC4 system and want to remove old posts from some of my boards.  I get the following error message: "Unable to verify referring url. Please go back and try again."

I have traced the problem to the appearance of an "action=adpro" in a 'old_url' that is tested by Security.php

Here is the thread I opened on the SMF support board.

http://www.simplemachines.org/community/index.php?topic=415940.0

I think that I have identified the source of the problem.  It seems that the
package Ad Seller Pro 1.0.8 is messing up the URL.

The error message is triggered by code in Security.php at lines 723 to 728 in
definition of function checkSession().  This function is called by function
RemoveOldTopics2() in RemoveTopics.php with the arguments shown:

   checkSession('post', 'admin');

At line 724 checkSession tests to see if the code 'action=admin' is present in
the URL returned by the PHP function $_SESSION['old_url'].  The test fails and
triggers the error 'verify_url_fail'.

To debug I inserted the following line of code after line 725 in Security.php

      log_error('old_url=[' . $_SESSION['old_url'] . ']');

This code returns the following in the error log:

http://...my board domain.../index.php?action=admin;area=maintain;sa=topics;activity=pruneold
old_url=[http://...my board domain.../index.php?action=adpro;sa=v&id=7&l=2&m=0&t=1297440989]

The second line above shows the problem.  It says 'action=adpro' not 'action=admin'
and the test fails.  It looks like Ad Seller Pro is messing up the old_url.

Now the question is how to fix it.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Ad Seller Pro breaks Remove Old Posts
« Reply #1 on: February 11, 2011, 12:02:31 pm »
Try changing the following

Open Sources/Subs.php

Find
Code: [Select]
// Remember this URL in case someone doesn't like sending HTTP_REFERER.
if (strpos($_SERVER['REQUEST_URL'], 'action=dlattach') === false && strpos($_SERVER['REQUEST_URL'], 'action=viewsmfile') === false)
$_SESSION['old_url'] = $_SERVER['REQUEST_URL'];


Change to
Code: [Select]
// Remember this URL in case someone doesn't like sending HTTP_REFERER.
if (strpos($_SERVER['REQUEST_URL'], 'action=dlattach') === false && strpos($_SERVER['REQUEST_URL'], 'action=adpro') === false && strpos($_SERVER['REQUEST_URL'], 'action=viewsmfile') === false)
$_SESSION['old_url'] = $_SERVER['REQUEST_URL'];

Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline David8

  • Member
  • *
  • Posts: 18
    • View Profile
Re: Ad Seller Pro breaks Remove Old Posts
« Reply #2 on: February 13, 2011, 04:54:26 pm »
Your hack fixed it.  Why did the problem occur?  Is Ad Seller Pro changing the old_url variable that SMF seems to rely on for verification? 

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Ad Seller Pro breaks Remove Old Posts
« Reply #3 on: February 13, 2011, 05:34:58 pm »
Will SMF logs all urls/actions so when a view occurs after the page is loaded that is the last url that is visited.

Will add the fix then update for RC5.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

 

Related Topics

  Subject / Started by Replies Last post
0 Replies
3360 Views
Last post October 13, 2008, 08:44:54 am
by darkorical
6 Replies
8179 Views
Last post January 22, 2010, 04:26:17 pm
by SMFHacks
Ad Seller Pro

Started by bulldog71169 « 1 2 » Support

16 Replies
9194 Views
Last post December 30, 2010, 05:18:11 pm
by bulldog71169
1 Replies
3027 Views
Last post January 04, 2011, 10:14:04 pm
by SMFHacks
3 Replies
3404 Views
Last post March 12, 2017, 01:13:00 pm
by Darkshadow

+- Recent Topics

Please Help! by SMFHacks
April 17, 2024, 08:04:55 am

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
March 30, 2024, 12:41:08 pm

Can't DROP 'id_member'; check that column/key exists Datei: by SMFHacks
March 30, 2024, 11:58:20 am

No thumbnails on new uploads by Tonyvic
March 29, 2024, 06:26:18 am

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

Powered by EzPortal