Montego Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic
Author Message
Slackervaara
Newbie
Newbie



Joined: Nov 03, 2007
Posts: 126

PostPosted: Mon Mar 10, 2008 4:40 am Reply with quote

I have problems with avatars with spaces in the name like Charlie Brown.gif

The RewriteRule is:

RewriteRule ^account-avatarsave-([a-z]*)-([\.a-zA-Z0-9_-]*).html modules.php?name=Your_Account&op=avatarsave&category=$1&avatar=$2 [L]

If I change to spaces like this:

RewriteRule ^account-avatarsave-([a-z]*)-([\.a-zA-Z0-9_- ]*).html modules.php?name=Your_Account&op=avatarsave&category=$1&avatar=$2 [L]

I get errors and this alternative can't be used. Grateful for suggestions!
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Mon Mar 10, 2008 7:46 am Reply with quote

Would you please expound upon what you mean exactly by "I get errors"? Thanks.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Slackervaara
Newbie
Newbie



Joined: Nov 03, 2007
Posts: 126

PostPosted: Mon Mar 10, 2008 9:10 am Reply with quote

Sorry. For instance Porky Pig.gif gives this link:
http://www.mysite.com/account-avatarsave-gallery-Porky.html%20Pig.gif

If I click on it to choose it, as avatar I get this error message:
Error: Wrong avatar format! Avatars can only be gif, jpg, or png format.

If I use ([^.]+)

I get:

http://www.mysite.com/account-avatarsave-gallery-Porky Pig.html.gif

Closer, but not perfect.
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Mon Mar 10, 2008 5:03 pm Reply with quote

Ok, we are kind of having to design/code/test on the fly. What I am thinking is that we might have to break this up differently. With both the GT file and .htaccess, try something along these lines instead:

RewriteRule ^account-avatarsave-([a-z]*)-([\.a-zA-Z0-9%_- ]*).html modules.php?name=Your_Account&op=avatarsave&category=$1&avatar=$2 [L]

It looks like phpBB is encoding the space or maybe that is browser/Apache based... I added the "%" into the mix to see what happens. The odd thing is that the period is escaped like this "\." which should also take into consideration the file extension. But, one thing at a time.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Slackervaara
Newbie
Newbie



Joined: Nov 03, 2007
Posts: 126

PostPosted: Mon Mar 10, 2008 5:17 pm Reply with quote

This gave server errors, because of the blank space in
[\.a-zA-Z0-9%_- ] and without the blank space, it did not give the correct result.
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Mon Mar 10, 2008 9:02 pm Reply with quote

Hhmmm... sorry, try the blank space in the GT file, but then with the .htaccess rule escape it like this:

[\.a-zA-Z0-9%_-\ ]

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Slackervaara
Newbie
Newbie



Joined: Nov 03, 2007
Posts: 126

PostPosted: Tue Mar 11, 2008 12:06 am Reply with quote

I tried that, but the \ gave server error in .htaccess, unfortunately, but blank space in GT file did not give that.
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Tue Mar 11, 2008 9:17 am Reply with quote

I don't understand why the difference. The escaped space works just fine for me.

Moral of the story? Don't use spaces! LOL.

Ok, just kidding. Will have to continue to dig into it...

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Slackervaara
Newbie
Newbie



Joined: Nov 03, 2007
Posts: 126

PostPosted: Tue Mar 11, 2008 3:04 pm Reply with quote

This seems to work on the test server [.a-zA-Z0-9+=\ ] but I have to test it tomorrow night on my site, when people are sleeping.
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Tue Mar 11, 2008 11:15 pm Reply with quote

Ok, I don't think that will work either on your production system as it wouldn't capture the %20? I guess we'll see.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Slackervaara
Newbie
Newbie



Joined: Nov 03, 2007
Posts: 126

PostPosted: Wed Mar 12, 2008 1:38 am Reply with quote

I have just tested it and it worked on the site, but I have modified a little to capture - [-.a-zA-Z0-9_+=\ ]. Many thanks for your help!
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Wed Mar 12, 2008 6:49 am Reply with quote

Thanks! I will make this thread a Sticky.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 4 Hours
 
Forums ©