realpath - Checks is a file is valid.
realpath([error:variable:]"file");
This function is used to check the validity of a file.
If the path of the file leads outside of the root of the website, it returns false.
If "error" is set, the following variables are also returned:
errcode : error code, errmsg : error message, path : normalize path of file, realpath : normaize real path of file.
Note: In the followings examples, the _ between the { should be removed to make it work.
res={_{ realpath(1,2); }}. return .*One file must be specified.* res={_{ realpath("../../../etc/passwd"); }}. return res=false. res={_{ realpath(error:a,"../../../etc/passwd"); a;}}. return .*The given path was above the root path.* res={_{ realpath(error:a,"../../html/passwd"); ";"; a.errmsg;}}. return res=true;. res={_{ realpath(error:a,"../../html/passwd"); a.errcode;}}. return res=true0. res={_{ realpath(error:a,"../../html/passwd"); a.path;}}. return res=true/html/passwd. res={_{ realpath(error:a,"../../html/passwd"); a.realpath;}}. return res=true/usr/local/website/v5/html/passwd.
Written by Pierre Laplante and Caroline Laplante, <laplante@sednove.com>
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
1.0 2014-09-09 21:24:14 laplante@sednove.com