Login
Sign Up For Free
English
中文 (繁體)
中文 (香港)
中文 (简体)
日本語
Filipino
Bahasa Indonesia
Bahasa Melayu
Pусский
Português (Brasil)
Magyar
Français
Español
Deutsch
Čeština
العربية
Català
Dansk
Ελληνικά
فارسی
Suomi
Gaeilge
Hindi
עברית
Hrvatski
Italiano
Norsk bokmål
Nederlands
한국어
Polski
Română
Slovenský
Svenska
Türkçe
українська
беларуская
ไทย
Standard view
l_l
asks
17 years ago
Is there any way to filter ½.WS from this? if(preg_match("/".str_replace("/", "\/", str_replace(".", "\.", $config->root))."/", $_GET['c']))
latest #25
Chris
17 years ago
That probably isn't even necessary. I'm still not sure what I was thinking when I programmed that part into there. Linking to itself ...
Chris
17 years ago
... most likely won't break it (even if they create a really long chain of redirects, which, in my opinion, would be fun.
)
l_l
17 years ago
Err...maybe that isn't the problem. For some reason, unless you enter in http:// in from of your link, it doesn't redirect.
立即下載
l_l
17 years ago
It just changes the url to
xn--12-c6t.ws/something....
Chris
17 years ago
That's your browser doing it. I guess you can add a check for the common protocols.
l_l
17 years ago
Wow, my code actually worked! Badass!
Chris
17 years ago
"D
Chris
17 years ago
*
l_l
17 years ago
Well, not quite.
yahoo.com
will create a different slug than
yahoo.com
, but they both head to the same place. Hmmm...
l_l
17 years ago
Thats supposed to be http://
yahoo.com
and
yahoo.com
l_l
17 years ago
Err...No they don't. http://
yahoo.com
now redirects to
http.com
. Dammit.
riverjiang
hates
17 years ago
PHP. It's so difficult to read.
l_l
17 years ago
Here's the current code.
pastie.org/224505
Chris
17 years ago
It's only difficult to read if you make it difficult to read.
Chris
17 years ago
(don't forget about
ftp://,
https://,
mailto:,
svn.. etc.
l_l
17 years ago
I need to get it to work first, chris.
Chris
17 years ago
Try this:
pastie.org/224506
l_l
17 years ago
Dammit Chris, you're too good. My tiger-style is no match for your php-fu.
Chris
17 years ago
Heh. Is it all working, now?
l_l
17 years ago
Hopefully. If not, I'll be sure to alert you just as you fall asleep.
Chris
17 years ago
Actually, it should be more like this:
to prevent things like httpd.apache.org from slipping through
Chris
17 years ago
oops
Chris
17 years ago
pastie.org/224512
riverjiang
thinks
17 years ago
you should add a "^" to match the beginning of the string: /^(http|mailto|svn):/
Chris
17 years ago
agrees.
back to top
delete
reply
edit
cancel
cancel