src/Burp.php
protected static function replacePattern($pattern, $container, $url, $conditional, $remove_conditional)
    {
        if (array_key_exists($pattern, $container)) {
            $replace = (count(self::$parameters[$pattern]) || $conditional) ? '('.$container[$pattern].')' : $container[$pattern];
            if ($conditional) {
                $replace = ($remove_conditional) ? '' : $replace.'?';
                $url = preg_replace('#\{'.$pattern.'\?\}#', $replace, $url);
            } else {
                $url = preg_replace('#\{'.$pattern.'\}#', $replace, $url);
            }
        }
        return $url;
    }
protected static function replacePattern($pattern, $container, $url, $conditional, $remove_conditional)
    {
        if (array_key_exists($pattern, $container)) {
            $replace = (count(self::$parameters[$pattern]) || $conditional) ? '('.$container[$pattern].')' : $container[$pattern];
            if ($conditional) {
                $replace = ($remove_conditional) ? '' : $replace.'?';
                $url = preg_replace('#\{'.$pattern.'\?\}#', $replace, $url);
            } else {
                $url = preg_replace('#\{'.$pattern.'\}#', $replace, $url);
            }
        }
        return $url;
    }
protected static function replacePattern ( $ pattern , $ container , $ url , $ conditional , $ remove_conditional ) { if ( array_key_exists ( $ pattern , $ container ) ) { $ replace = ( count ( self :: $ parameters [ $ pattern ] ) || $ conditional ) ? '(' . $ container [ $ pattern ] . ')' : $ container [ $ pattern ] ; if ( $ conditional ) { $ replace = ( $ remove_conditional ) ? '' : $ replace . '?' ; $ url = preg_replace ( '#\{' . $ pattern . '\?\}#' , $ replace , $ url ) ; } else { $ url = preg_replace ( '#\{' . $ pattern . '\}#' , $ replace , $ url ) ; } } return $ url ; }
replace a pattern in an array of rules

@param $pattern
@param $container
@param $url
@param $conditional
@param $remove_conditional
@return string
replace a pattern in an array of rules