commit d7d21f71169c195dd4a34a3df2ab689b3ed61ef1
parent 716772f0bbed9f29e7ce2b3ade0bde3f9d6b8d79
Author: markseu <mark2011@mayberg.se>
Date: Fri, 21 Mar 2014 11:05:23 +0100
Core update (normalisation is good for you)
Diffstat:
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/system/core/core.php b/system/core/core.php
@@ -5,7 +5,7 @@
// Yellow main class
class Yellow
{
- const Version = "0.2.13";
+ const Version = "0.2.14";
var $page; //current page
var $pages; //pages from file system
var $config; //configuration
@@ -1485,20 +1485,20 @@ class YellowToolbox
return $fileNames;
}
- // Normalise directory/file name
- function normaliseName($text, $removeExtension = false, $lowerCase = false)
+ // Normalise directory/file/attribute name
+ function normaliseName($text, $removeExtension = false, $filterStrict = false)
{
if(preg_match("/^[\d\-\_\.]+(.*)$/", $text, $matches)) $text = $matches[1];
if($removeExtension) $text = ($pos = strrposu($text, '.')) ? substru($text, 0, $pos) : $text;
- if($lowerCase) $text = strtoloweru($text);
+ if($filterStrict) $text = strreplaceu('.', '-', strtoloweru($text));
return preg_replace("/[^\pL\d\-\_\.]/u", "-", $text);
}
// Normalise location arguments
- function normaliseArgs($text, $appendSlash = true, $lowerCase = true)
+ function normaliseArgs($text, $appendSlash = true, $filterStrict = true)
{
if($appendSlash) $text .= '/';
- if($lowerCase) $text = strreplaceu(' ', '-', strtoloweru($text));
+ if($filterStrict) $text = strreplaceu(' ', '-', strtoloweru($text));
return strreplaceu(array('%3A','%2F'), array(':','/'), rawurlencode($text));
}