| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Regular Join Date: May 2005 Location: England
Posts: 392
![]() ![]() ![]() | Reversing url_encode type effect in perl? Hey, There is an upload script i'm using, it locks the files and only chmods them to 600, making them virtually impossible to access in php, i've managed to deconstruct how it works but to get perl to chmod the file i need to know the file name... but it only has it in url encoded form: ????: NamePros.com http://www.namepros.com/programming/324453-resolved-reversing-url_encode-type-effect-perl.html Code: $tmp_filename =~ s/([^a-zA-Z0-9_\-.])/uc sprintf("%%%02x",ord($1))/eg; Resolved. Some guy over at devshed gave the code to reverse :-) For future reference the opposite would be: Code: $tmp_filename =~ s{%([a-fA-F0-9][a-fA-F0-9])}{pack("C", hex($1))}eg;
__________________ -Beaver6813.com - Web Developer Extraordinaire! |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |