protected function unmaskUrl($url, array $params)
	{
		if ( !preg_match_all('/\{([^{}]+)\}/', $url, $matches) ) {
			return array($url, $params);
		}

		$url_masks = array_unique($matches[0]);
		$parameter_names = array_unique($matches[1]);
		$mask_replacements = array();
		$missing_parameters = array();

		foreach ( $parameter_names as $parameter_name ) {
			if ( !array_key_exists($parameter_name, $params) ) {
				$missing_parameters[] = $parameter_name;
				continue;
			}

			$mask_replacements[] = rawurlencode($params[$parameter_name]);
			unset($params[$parameter_name]);
		}

		if ( $missing_parameters ) {
			throw new MissingParametersException($missing_parameters);
		}

		return array(str_replace($url_masks, $mask_replacements, $url), $params);
	}