[encode_urlpath]

Description

Link: [encode_urlpath]
Author: Jason Huck
Category: Encoding
Version: 8.x
License:
Posted: Mar. 03, 2006
Updated: Mar. 22, 2006
More by this author...
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.

Parameters

none


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.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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

none

Email:


Password:



Newest

Most Popular