Merge branch 'rhymix:master' into master

This commit is contained in:
Lastorder 2026-02-12 14:03:54 +09:00 committed by GitHub
commit aba6016986
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 224 additions and 194 deletions

View file

@ -3,7 +3,7 @@
/**
* RX_VERSION is the version number of the Rhymix CMS.
*/
define('RX_VERSION', '2.1.29');
define('RX_VERSION', '2.1.30');
/**
* RX_MICROTIME is the startup time of the current script, in microseconds since the Unix epoch.

View file

@ -207,9 +207,13 @@ class URL
*/
public static function encodeIdna(string $url): string
{
if (preg_match('@[:/#]@', $url))
if (!preg_match('@^/(?!/)@', $url) && preg_match('@[:/#]@', $url))
{
$domain = parse_url($url, \PHP_URL_HOST);
if (!$domain)
{
return $url;
}
$position = strpos($url, $domain);
if ($position === false)
{
@ -243,9 +247,13 @@ class URL
*/
public static function decodeIdna(string $url): string
{
if (preg_match('@[:/#]@', $url))
if (!preg_match('@^/(?!/)@', $url) && preg_match('@[:/#]@', $url))
{
$domain = parse_url($url, \PHP_URL_HOST);
if (!$domain)
{
return $url;
}
$position = strpos($url, $domain);
if ($position === false)
{