Blame Scripts/Php/Webenv/admin/includes/functions/url.php

878a2b
878a2b
/***
878a2b
 * URL's functions
878a2b
 *
878a2b
 */
878a2b
878a2b
878a2b
//-----------/* Sanitize URL variables */
878a2b
    
878a2b
    function sanitize_url_var( $name )
878a2b
    {
878a2b
        if ( ! preg_match( '/^(page|action|id)$/', $name ) )
878a2b
        {
878a2b
            return false;
878a2b
        }
878a2b
878a2b
        switch ( $name )
878a2b
        {
878a2b
            case 'page': 
878a2b
                if ( isset($_GET[$name]) && preg_match( '/^(users|pages|categories|comments|entries|links)$/', $_GET[$name] ) )
878a2b
                {
878a2b
                    return true;
878a2b
                }
878a2b
                else
878a2b
                {
878a2b
                    return false;
878a2b
                }
878a2b
            break;
878a2b
878a2b
            case 'action':
878a2b
                if ( isset( $_GET[$name] ) && preg_match( '/^(update|add|tree|logout)$/', $_GET[$name] ) )
878a2b
                {
878a2b
                    return true;
878a2b
                }
878a2b
                else
878a2b
                {
878a2b
                    return false;
878a2b
                }
878a2b
            break;
878a2b
878a2b
            case 'id':
878a2b
                if ( isset( $_GET[$name] ) && preg_match( '/^[0-9]+$/', $_GET[$name] ) )
878a2b
                {
878a2b
                    return true;
878a2b
                }
878a2b
                else
878a2b
                {
878a2b
                    return false;
878a2b
                }
878a2b
            break;
878a2b
        }
878a2b
    }
878a2b
?>