Lasso Soft Inc. > Home

[encode_urlpath]

Linkencode_urlpath
AuthorJason Huck
CategoryEncoding
Version8.x
Licensehttp://opensource.org/licenses/artistic-license.php
Posted03 Mar 2006
Updated22 Mar 2006
More by this author...

Description

This tag is part of a workaround for a security measure in Apache that complains about URL path components that contain URL-encoded slashes. Can be decoded using [decode_urlpath].

This tag is designed to be used with the [define_atbegin] method of URL rewriting. Since the regular expression commonly used in the <LocationMatch> directive with that method only passes virtual paths that do not contain periods, periods are also encoded. The tag also converts spaces to underscores for improved readability.

Sample Usage

encode_urlpath($string);

Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.

define_tag(
	'urlpath',
	-namespace='encode_',
	-required='in',
	-priority='replace',
	-description='Makes a string safe to use as a URL path component with Apache.'
);		
	local('out') = #in;		
	#out->replace(' ','_')&replace('/','-!')&replace('\'','`');
	#out = encode_stricturl(#out);
	#out->replace('.','.')&replace('%5c','\');
	return(@#out);
/define_tag;

Related Tags

Comments

No comments

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft