Login to download the latest version of Mint and your favorite Pepper, purchase additional licenses, or post in the Forum. Don't have an account? Create one!

In Partnership with Media Temple

Mint Forum

Outbound Pepper issues

Hello,

I was hoping someone might be able to help me with this… I am running into some problems with the Outbound Pepper. I downloaded a fresh copy, and installed it on my mint installation, here: falkencreative.com/mint

It appears that nearly everything is functioning correctly, with the exception of the Outbound Pepper. It is not recording any data (no data shows up in the database), and when I check the activities pane in Safari, it appears that requests are returning a 403 forbidden error.

For example:

/mint/pepper/shauninman/outbound/click.php?1232734929164&to=http%3A//www.twitter.com/falkencreative&to_title=Twitter&from=http%3A//www.falkencreative.com/contact.php&from_title=Contact%20%7C%20Falken%20Creative&from_title_encoded=1

will return “You don’t have permission to access /mint/pepper/shauninman/outbound/click.php on this server.”

Is there anything I can do to fix this problem, short of removing the pepper? Anything I should try? falkencreative.com/mint/?errors doesn’t show any errors, so that should be fine… I have removed my .htaccess file just in case, and that doesn’t appear to make any different either.

In my case with the pepper, it was something my host had to change at their end, my domain was triggering a mod_security rule that underneath their config, couldn’t be changed through a .htaccess file - That may be one possibility.

With you having a permission problem, have you double checked that none of the CHMOD values have been altered on the directories in question?

I played with it a little more… It appears like it has something to do with the way the URL is encoded. For example, this works (with %3A removed from the two URLS), but my sample in my above post doesn’t:

/mint/pepper/shauninman/outbound/click.php?1232734929164&to=http//www.twitter.com/falkencreative&to_title=Twitter&from=http//www.falkencreative.com/contact.php&from_title=Contact%20|%20Falken%20Creative&from_title_encoded=1

It appears like it doesn’t like these characters in the URL

%3A

Any idea if that is a server issue that I would contact my host about, or a issue with the script itself?

And yes, I have checked, and permissions are fine.

%3A is a problem with the encoding of your URL as it’s converting the colon.

I’m not sure if this is something that your host can change or if you would need the change the encoding on your own pages and make sure that it is properly declared.

Not sure if this helps much but check out the URL Help Page here.

“%3A is a problem with the encoding of your URL as it’s converting the colon.

I’m not sure if this is something that your host can change or if you would need the change the encoding on your own pages and make sure that it is properly declared.”

Just pointing this out… I haven’t touched the code in the Outbound pepper — this is simply the way that the pepper works. I’m really not sure how to go about changing the encoding on my own pages… as far as I know, there is nothing wrong with them.

OK, a quick update… I’ve fixed it, though it did require a little bit of hackery. In case anyone else has this problem for some reason, here is my solution:

(still don’t know why this was a problem in the first place, though)

Overall method: I adjusted the javascript file to remove “http:” from the beginning of the “to” and “from” URLS, and then added them back on in the PHP code before the URLs were saved in the database.

Potential issues: The only downside to this is that it won’t properly distinguish between http: and https:, so https: links won’t be tracked. I don’t have any links that include https:, and probably won’t in the future, so it shouldn’t be a problem.

Code:

script.js:

after these lines:

var to = (window.decodeURI)?window.decodeURI(this.href):this.href; var from = (window.decodeURI)?window.decodeURI(document.URL):document.URL; var to_title = (this.title && this.title != ”)?this.title:this.innerHTML;

I added:

to = to.replace(/http:/gi, “”); from = from.replace(/http:/gi, “”);

Classes.php:

after these lines:

$to = $this->escapeSQL(preg_replace(‘/#.$/’, ”, htmlentities($_GET[‘to’]))); $raw_to_title = $_GET[‘to_title’]; $from = $this->escapeSQL(preg_replace(‘/#.$/’, ”, htmlentities($_GET[‘from’]))); $from_title = ($_GET[‘from_title_encoded’]) ? $_GET[‘from_title’] : htmlentities($_GET[‘from_title’]); $from_title = $this->escapeSQL(trim(str_replace(‘n’, ’ ‘, preg_replace(‘/%u([dw]{4})/’, ‘&#x$1;’, $from_title))));

I added:

$to = ‘http:’.$to; $from = ‘http:’.$from;

shep
Minted
Posted on Jan 25, '09 at 11:39 pm

i’ll have to try this fix out tomorrow because i’m experiencing the same issue on my mint install.

Shaun Inman
Mint/Pepper Developer
Posted on Jan 26, '09 at 09:26 am

You should not have to modify the source code. There is nothing wrong with your pages or the way the Pepper works. Your server is preventing the Pepper from ever receiving the request. This is often caused by an overzealous mod_security setting. You can fix it with a simple addition of an .htaccess file (or to if one already exists) in your Mint directory.

Disregard the error number (hosts often send incorrect error numbers to throw off those who might try to circumvent the mod for spamming reasons) but follow these instructions.

I actually did try the htaccess suggestion, and it wasn’t working for me. It may be something to do with my hosting provider… I’m not really sure.

Try contacting your host and see if you are triggering a mod_security rule. I tried the .htaccess approach too but it didn’t work for me either as my host had disabled the technique of turning it off through .htaccess files.

Once my host had changed things their end, all worked fine.

You must be logged in to reply. Login above or create an account