1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-22 14:23:05 +02:00

Various minor updates

This commit is contained in:
Ryan Cramer
2025-01-10 10:27:09 -05:00
parent 4604c09abc
commit 4e678c1584
5 changed files with 41 additions and 19 deletions

View File

@@ -1174,10 +1174,12 @@ class Sanitizer extends Wire {
*/
protected function getPunycodeVersion($version = 0) {
$config = $this->wire()->config;
if(!$version && strpos($config->pageNameWhitelist, 'v') === 0) {
// i.e. "v3" specified at beginning of pageNameWhitelist
$version = substr($config->pageNameWhitelist, 1, 1);
$version = ctype_digit($version) ? (int) $version : 0;
if(!$version) {
$whitelist = $config->pageNameWhitelist;
for($n = 3; $n > 0; $n--) {
if(strpos($whitelist, "v$n") !== false) $version = $n;
if($version) break;
}
}
if(!$version) $version = $config->installedAfter('2025-01-04') ? 3 : 1;
if(!function_exists('idn_to_utf8')) $version = 2;