Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> ShortLinks/TegoNuke
Author Message
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1775

PostPosted: Sun Mar 03, 2013 12:18 pm Reply with quote

I have a issue with specialchars in the shortlinks of the usernames. It's possible to add in RN25+ usernames with specialchars without any filterings.

the known result:

userinfo-neralex.html

but if i'm adding/changing now a user like this: "töäüst", then i get the following result:

userinfo-t.htmlöäüst

Any ideas to solve this one or is it better to create a filter/check while the registration or while adding users with the admin area of Your_Account?

_________________
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message
spasticdonkey
RavenNuke(tm) Development Team



Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Sun Mar 03, 2013 6:39 pm Reply with quote

That looks like a broken match pattern in ShortLinks, so I think it would be possible to figure out a solution...

The pattern used for that URL:
([a-zA-Z0-9_-]*)

Will only work for English A-Z, a-z, 0-9. You will need to change it to match unicode characters, in both .htaccess and GT_Your_Account... Assuming shortlinks itself is compatible.

I know \b\p{L}+\b will match an entire word of Unicode characters, but you'll have to play with it to see what works; as I have no easy way to test it Smile
 
View user's profile Send private message Visit poster's website
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Mon Mar 04, 2013 5:58 am Reply with quote

Whatever is supported by the preg_match() function in your environment should work with ShortLinks.

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
neralex







PostPosted: Tue Mar 05, 2013 5:44 am Reply with quote

Thanks guys, but to me there is missing a few more examples or links with solutions. Expressions are not my best skill. It will not work.
 
spasticdonkey







PostPosted: Tue Mar 05, 2013 7:41 am Reply with quote

I played with this some and got your example to shorten correctly, but having issues with the url working correctly when clicked (not found).

The requested URL /userinfo-töäüst.html was not found on this server.

The pattern I used was not too elegant, but seemed to work outside of the server not understanding the URL
([a-zA-Z0-9\-\_\Ä\ä\Ö\ö\Ü\ü]*)

Maybe your server environment will have better luck? At least it's something else to try.. The problem only seems to happen with shortlinks enabled, as the long url functions ok (at least in my test environment)...
modules.php ? name=Your_Account&op=userinfo&username=töäüst

(which makes me think the problem may lay in apache/modrewrite and how these characters are handled)
 
neralex







PostPosted: Tue Mar 05, 2013 8:47 am Reply with quote

Thanks. I have it replaced in the tap file of my module and in the apache rule isnide the .htaccess file. It works for one module but if i have activated the AutoTapLinks in the rnconfig.php, then i get the same issue page wide. I have changed for testing the tap file from Your_Account too but it was ignored. I will give up, because here comes more problems. All links with this username creating now validation issues and i think here is a lot of work to do, to get clear usernames with specialschars. Maybe is it a new point on the to-do list for upcoming RN versions.
 
montego







PostPosted: Tue Mar 05, 2013 7:56 pm Reply with quote

neralex, AutoTapLinks being on will require you to make the change in ALL the GT-*.php files where this username needs to be rewritten. That link could be quite prevalent amongst many of the modules. You will need to find them all to ensure all our tapped correctly.

Glad to hear you go the .htaccess part working fine. Not sure why spasticdonkey's didn't. Probably some kind of Apache configuration setting issue, but I wouldn't have a clue which one. I have not been looking forward to tackling "tapping" in a true UTF-8 environment which is why I have been pushing for a Link Factory approach instead for the new CMS - but it would require a ton of core code changes in each module to use the new API.
 
montego







PostPosted: Tue Mar 05, 2013 8:29 pm Reply with quote

Looks like the up-front configuration of mod rewrite in .htaccess may need to look something like this:

Code:


AddDefaultCharset UTF-8

RewriteEngine on

RewriteBase /


You don't have to have the last directive, but I just always do. I think that default char set may be needed or help?????
 
spasticdonkey







PostPosted: Wed Mar 06, 2013 9:11 am Reply with quote

I played some more with it, with no positive results. Having trouble determining if my local testing site has PHP compiled with PCRE UTF-8 support... Which is required for look-ahead assertions like \b\p{L}+\b

I don't find mention in my php.ini or phpinfo() that it is "Compiled with UTF-8 support" but not sure I'm looking in the right places.

Looking forward to a "link factory" more and more Smile
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> ShortLinks/TegoNuke

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
You can attach files in this forum
You can download files in this forum


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