"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "framework/validators/CUrlValidator.php" between
yii-1.1.21.733ac5.tar.gz and yii-1.1.22.bf1d26.tar.gz

About: Yii is a high-performance component-based PHP framework for developing large-scale Web applications. Hint: Yii 1.1 is now in maintenance mode.

CUrlValidator.php  (yii-1.1.21.733ac5):CUrlValidator.php  (yii-1.1.22.bf1d26)
skipping to change at line 172 skipping to change at line 172
* Converts given IDN to the punycode. * Converts given IDN to the punycode.
* @param string $value IDN to be converted. * @param string $value IDN to be converted.
* @return string resulting punycode. * @return string resulting punycode.
* @since 1.1.13 * @since 1.1.13
*/ */
private function encodeIDN($value) private function encodeIDN($value)
{ {
if(preg_match_all('/^(.*):\/\/([^\/]+)(.*)$/',$value,$matches)) if(preg_match_all('/^(.*):\/\/([^\/]+)(.*)$/',$value,$matches))
{ {
if(function_exists('idn_to_ascii')) if(function_exists('idn_to_ascii'))
$value=$matches[1][0].'://'.idn_to_ascii($matches {
[2][0]).$matches[3][0]; $value=$matches[1][0].'://';
if (defined('IDNA_NONTRANSITIONAL_TO_ASCII') && d
efined('INTL_IDNA_VARIANT_UTS46'))
{
$value.=idn_to_ascii($matches[2][0],IDNA_
NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46);
}
else
{
$value.=idn_to_ascii($matches[2][0]);
}
$value.=$matches[3][0];
}
else else
{ {
require_once(Yii::getPathOfAlias('system.vendors. Net_IDNA2.Net').DIRECTORY_SEPARATOR.'IDNA2.php'); require_once(Yii::getPathOfAlias('system.vendors. Net_IDNA2.Net').DIRECTORY_SEPARATOR.'IDNA2.php');
$idna=new Net_IDNA2(); $idna=new Net_IDNA2();
$value=$matches[1][0].'://'.@$idna->encode($match es[2][0]).$matches[3][0]; $value=$matches[1][0].'://'.@$idna->encode($match es[2][0]).$matches[3][0];
} }
} }
return $value; return $value;
} }
skipping to change at line 194 skipping to change at line 205
* Converts given punycode to the IDN. * Converts given punycode to the IDN.
* @param string $value punycode to be converted. * @param string $value punycode to be converted.
* @return string resulting IDN. * @return string resulting IDN.
* @since 1.1.13 * @since 1.1.13
*/ */
private function decodeIDN($value) private function decodeIDN($value)
{ {
if(preg_match_all('/^(.*):\/\/([^\/]+)(.*)$/',$value,$matches)) if(preg_match_all('/^(.*):\/\/([^\/]+)(.*)$/',$value,$matches))
{ {
if(function_exists('idn_to_utf8')) if(function_exists('idn_to_utf8'))
$value=$matches[1][0].'://'.idn_to_utf8($matches[ {
2][0]).$matches[3][0]; $value=$matches[1][0].'://';
if (defined('IDNA_NONTRANSITIONAL_TO_ASCII') && d
efined('INTL_IDNA_VARIANT_UTS46'))
{
$value.=idn_to_utf8($matches[2][0],IDNA_N
ONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46);
}
else
{
$value=idn_to_utf8($matches[2][0]);
}
$value.=$matches[3][0];
}
else else
{ {
require_once(Yii::getPathOfAlias('system.vendors. Net_IDNA2.Net').DIRECTORY_SEPARATOR.'IDNA2.php'); require_once(Yii::getPathOfAlias('system.vendors. Net_IDNA2.Net').DIRECTORY_SEPARATOR.'IDNA2.php');
$idna=new Net_IDNA2(); $idna=new Net_IDNA2();
$value=$matches[1][0].'://'.@$idna->decode($match es[2][0]).$matches[3][0]; $value=$matches[1][0].'://'.@$idna->decode($match es[2][0]).$matches[3][0];
} }
} }
return $value; return $value;
} }
} }
 End of changes. 2 change blocks. 
4 lines changed or deleted 28 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)