replaced deprecated utf8 functions
For now this uses full qualified namespaces, sensible imports may come later.
This commit is contained in:
parent
ffdb5936fc
commit
8cbc5ee84f
|
@ -124,7 +124,7 @@ class media_searchlist_test extends DokuWikiTest {
|
|||
$info = array();
|
||||
$info['id'] = $this->upload_ns . ':' . $rel_id;
|
||||
$info['perm'] = auth_quickaclcheck(getNS($info['id']).':*');
|
||||
$info['file'] = utf8_basename($file);
|
||||
$info['file'] = \dokuwiki\Utf8\PhpString::basename($file);
|
||||
$info['size'] = filesize($file);
|
||||
$info['mtime'] = filemtime($file);
|
||||
$info['writable'] = is_writable($file);
|
||||
|
|
|
@ -84,8 +84,8 @@ class utf8_basename_test extends DokuWikiTest {
|
|||
);
|
||||
|
||||
foreach($data as $test){
|
||||
$this->assertEquals($test[2], utf8_basename($test[0], $test[1]), "input: ('".$test[0]."', '".$test[1]."')");
|
||||
$this->assertEquals($test[2], \dokuwiki\Utf8\PhpString::basename($test[0], $test[1]), "input: ('".$test[0]."', '".$test[1]."')");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ class utf8_correctidx_test extends DokuWikiTest {
|
|||
$tests[] = array('aaживπά우리をあöä',1,true,1);
|
||||
|
||||
foreach($tests as $test){
|
||||
$this->assertEquals(utf8_correctIdx($test[0],$test[1],$test[2]),$test[3]);
|
||||
$this->assertEquals(\dokuwiki\Utf8\Clean::correctIdx($test[0],$test[1],$test[2]),$test[3]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ class utf8_correctidx_test extends DokuWikiTest {
|
|||
$tests[] = array('aaживπά우리をあöä',4,true,4);
|
||||
|
||||
foreach($tests as $test){
|
||||
$this->assertEquals(utf8_correctIdx($test[0],$test[1],$test[2]),$test[3]);
|
||||
$this->assertEquals(\dokuwiki\Utf8\Clean::correctIdx($test[0],$test[1],$test[2]),$test[3]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ class utf8_correctidx_test extends DokuWikiTest {
|
|||
$tests[] = array('aaживπά우리をあöä',13,true,13);
|
||||
|
||||
foreach($tests as $test){
|
||||
$this->assertEquals(utf8_correctIdx($test[0],$test[1],$test[2]),$test[3]);
|
||||
$this->assertEquals(\dokuwiki\Utf8\Clean::correctIdx($test[0],$test[1],$test[2]),$test[3]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@ class utf8_correctidx_test extends DokuWikiTest {
|
|||
$tests[] = array('aaживπά우리をあöä',128,true,29);
|
||||
|
||||
foreach($tests as $test){
|
||||
$this->assertEquals(utf8_correctIdx($test[0],$test[1],$test[2]),$test[3]);
|
||||
$this->assertEquals(\dokuwiki\Utf8\Clean::correctIdx($test[0],$test[1],$test[2]),$test[3]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,61 +8,61 @@ class utf8_html_test extends DokuWikiTest {
|
|||
function test_from_1byte(){
|
||||
$in = 'a';
|
||||
$out = 'a';
|
||||
$this->assertEquals(utf8_tohtml($in),$out);
|
||||
$this->assertEquals(\dokuwiki\Utf8\Conversion::toHtml($in),$out);
|
||||
}
|
||||
|
||||
function test_from_2byte(){
|
||||
$in = "\xc3\xbc";
|
||||
$out = 'ü';
|
||||
$this->assertEquals(utf8_tohtml($in),$out);
|
||||
$this->assertEquals(\dokuwiki\Utf8\Conversion::toHtml($in),$out);
|
||||
}
|
||||
|
||||
function test_from_3byte(){
|
||||
$in = "\xe2\x99\x8a";
|
||||
$out = '♊';
|
||||
$this->assertEquals(utf8_tohtml($in),$out);
|
||||
$this->assertEquals(\dokuwiki\Utf8\Conversion::toHtml($in),$out);
|
||||
}
|
||||
|
||||
function test_from_4byte(){
|
||||
$in = "\xf4\x80\x80\x81";
|
||||
$out = '􀀁';
|
||||
$this->assertEquals(utf8_tohtml($in),$out);
|
||||
$this->assertEquals(\dokuwiki\Utf8\Conversion::toHtml($in),$out);
|
||||
}
|
||||
|
||||
function test_to_1byte(){
|
||||
$out = 'a';
|
||||
$in = 'a';
|
||||
$this->assertEquals(utf8_unhtml($in),$out);
|
||||
$this->assertEquals(\dokuwiki\Utf8\Conversion::fromHtml($in),$out);
|
||||
}
|
||||
|
||||
function test_to_2byte(){
|
||||
$out = "\xc3\xbc";
|
||||
$in = 'ü';
|
||||
$this->assertEquals(utf8_unhtml($in),$out);
|
||||
$this->assertEquals(\dokuwiki\Utf8\Conversion::fromHtml($in),$out);
|
||||
}
|
||||
|
||||
function test_to_3byte(){
|
||||
$out = "\xe2\x99\x8a";
|
||||
$in = '♊';
|
||||
$this->assertEquals(utf8_unhtml($in),$out);
|
||||
$this->assertEquals(\dokuwiki\Utf8\Conversion::fromHtml($in),$out);
|
||||
}
|
||||
|
||||
function test_to_4byte(){
|
||||
$out = "\xf4\x80\x80\x81";
|
||||
$in = '􀀁';
|
||||
$this->assertEquals(utf8_unhtml($in),$out);
|
||||
$this->assertEquals(\dokuwiki\Utf8\Conversion::fromHtml($in),$out);
|
||||
}
|
||||
|
||||
function test_without_entities(){
|
||||
$out = '&&';
|
||||
$in = '&&';
|
||||
$this->assertEquals(utf8_unhtml($in),$out);
|
||||
$this->assertEquals(\dokuwiki\Utf8\Conversion::fromHtml($in),$out);
|
||||
}
|
||||
|
||||
function test_with_entities(){
|
||||
$out = '&&';
|
||||
$in = '&&';
|
||||
$this->assertEquals(utf8_unhtml($in,HTML_ENTITIES),$out);
|
||||
$this->assertEquals(\dokuwiki\Utf8\Conversion::fromHtml($in,HTML_ENTITIES),$out);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ class utf8_romanize_test extends DokuWikiTest {
|
|||
foreach($tests as $test){
|
||||
list($jap,$rom) = explode(';',trim($test));
|
||||
|
||||
$chk = utf8_romanize($jap);
|
||||
$chk = \dokuwiki\Utf8\Clean::romanize($jap);
|
||||
$this->assertEquals($rom,$chk,"$jap\t->\t$chk\t!=\t$rom\t($line)");
|
||||
$line++;
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ class utf8_romanize_test extends DokuWikiTest {
|
|||
* @author Andreas Gohr <andi@splitbrain.org>
|
||||
*/
|
||||
function test_deaccented(){
|
||||
$this->assertEquals("a A a A a o O",utf8_romanize("å Å ä Ä ä ö Ö"));
|
||||
$this->assertEquals("a A a A a o O",\dokuwiki\Utf8\Clean::romanize("å Å ä Ä ä ö Ö"));
|
||||
}
|
||||
}
|
||||
//Setup VIM: ex: et ts=4 :
|
||||
|
|
|
@ -19,7 +19,7 @@ class utf8_stripspecials extends DokuWikiTest {
|
|||
$tests[] = array('string with nbsps','_','\*','string_with_nbsps');
|
||||
|
||||
foreach($tests as $test){
|
||||
$this->assertEquals(utf8_stripspecials($test[0],$test[1],$test[2]),$test[3]);
|
||||
$this->assertEquals(\dokuwiki\Utf8\Clean::stripspecials($test[0],$test[1],$test[2]),$test[3]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ class utf8_strtolower_test extends DokuWikiTest {
|
|||
);
|
||||
|
||||
foreach($data as $input => $expected) {
|
||||
$this->assertEquals($expected, utf8_strtolower($input));
|
||||
$this->assertEquals($expected, \dokuwiki\Utf8\PhpString::strtolower($input));
|
||||
}
|
||||
|
||||
// just make sure our data was correct
|
||||
|
@ -20,4 +20,4 @@ class utf8_strtolower_test extends DokuWikiTest {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ class utf8_substr_test extends DokuWikiTest {
|
|||
$tests[] = array('живπά우리をあöä',-6,-2,'우리をあ');
|
||||
|
||||
foreach($tests as $test){
|
||||
$this->assertEquals(utf8_substr($test[0],$test[1],$test[2]),$test[3]);
|
||||
$this->assertEquals(\dokuwiki\Utf8\PhpString::substr($test[0],$test[1],$test[2]),$test[3]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ class utf8_substr_test extends DokuWikiTest {
|
|||
$tests[] = array($str,0,66002,$str);
|
||||
|
||||
foreach($tests as $test){
|
||||
$this->assertEquals(utf8_substr($test[0],$test[1],$test[2]),$test[3]);
|
||||
$this->assertEquals(\dokuwiki\Utf8\PhpString::substr($test[0],$test[1],$test[2]),$test[3]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,49 +8,49 @@ class utf8_unicode_test extends DokuWikiTest {
|
|||
function test_from_1byte(){
|
||||
$in = 'a';
|
||||
$out = array(97);
|
||||
$this->assertEquals(utf8_to_unicode($in),$out);
|
||||
$this->assertEquals(\dokuwiki\Utf8\Unicode::fromUtf8($in),$out);
|
||||
}
|
||||
|
||||
function test_from_2byte(){
|
||||
$in = "\xc3\xbc";
|
||||
$out = array(252);
|
||||
$this->assertEquals(utf8_to_unicode($in),$out);
|
||||
$this->assertEquals(\dokuwiki\Utf8\Unicode::fromUtf8($in),$out);
|
||||
}
|
||||
|
||||
function test_from_3byte(){
|
||||
$in = "\xe2\x99\x8a";
|
||||
$out = array(9802);
|
||||
$this->assertEquals(utf8_to_unicode($in),$out);
|
||||
$this->assertEquals(\dokuwiki\Utf8\Unicode::fromUtf8($in),$out);
|
||||
}
|
||||
|
||||
function test_from_4byte(){
|
||||
$in = "\xf4\x80\x80\x81";
|
||||
$out = array(1048577);
|
||||
$this->assertEquals(utf8_to_unicode($in),$out);
|
||||
$this->assertEquals(\dokuwiki\Utf8\Unicode::fromUtf8($in),$out);
|
||||
}
|
||||
|
||||
function test_to_1byte(){
|
||||
$out = 'a';
|
||||
$in = array(97);
|
||||
$this->assertEquals(unicode_to_utf8($in),$out);
|
||||
$this->assertEquals(\dokuwiki\Utf8\Unicode::toUtf8($in),$out);
|
||||
}
|
||||
|
||||
function test_to_2byte(){
|
||||
$out = "\xc3\xbc";
|
||||
$in = array(252);
|
||||
$this->assertEquals(unicode_to_utf8($in),$out);
|
||||
$this->assertEquals(\dokuwiki\Utf8\Unicode::toUtf8($in),$out);
|
||||
}
|
||||
|
||||
function test_to_3byte(){
|
||||
$out = "\xe2\x99\x8a";
|
||||
$in = array(9802);
|
||||
$this->assertEquals(unicode_to_utf8($in),$out);
|
||||
$this->assertEquals(\dokuwiki\Utf8\Unicode::toUtf8($in),$out);
|
||||
}
|
||||
|
||||
function test_to_4byte(){
|
||||
$out = "\xf4\x80\x80\x81";
|
||||
$in = array(1048577);
|
||||
$this->assertEquals(unicode_to_utf8($in),$out);
|
||||
$this->assertEquals(\dokuwiki\Utf8\Unicode::toUtf8($in),$out);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -12,14 +12,14 @@ class utf8_utf16be_test extends DokuWikiTest {
|
|||
* Convert from UTF-8 to UTF-16BE
|
||||
*/
|
||||
function test_to16be(){
|
||||
$this->assertEquals(utf8_to_utf16be($this->utf8), $this->utf16);
|
||||
$this->assertEquals(\dokuwiki\Utf8\Conversion::toUtf16Be($this->utf8), $this->utf16);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert from UTF-16BE to UTF-8
|
||||
*/
|
||||
function test_from16be(){
|
||||
$this->assertEquals(utf16be_to_utf8($this->utf16),$this->utf8);
|
||||
$this->assertEquals(\dokuwiki\Utf8\Conversion::fromUtf16Be($this->utf16),$this->utf8);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ class PageCLI extends CLI {
|
|||
}
|
||||
|
||||
if(empty($localfile)) {
|
||||
$localfile = getcwd() . '/' . utf8_basename($wiki_fn);
|
||||
$localfile = getcwd() . '/' . \dokuwiki\Utf8\PhpString::basename($wiki_fn);
|
||||
}
|
||||
|
||||
if(!file_exists(dirname($localfile))) {
|
||||
|
|
|
@ -47,7 +47,7 @@ class Sitemap extends AbstractAction {
|
|||
if(is_readable($sitemap)) {
|
||||
// Send headers
|
||||
header('Content-Type: ' . $mime);
|
||||
header('Content-Disposition: attachment; filename=' . utf8_basename($sitemap));
|
||||
header('Content-Disposition: attachment; filename=' . \dokuwiki\Utf8\PhpString::basename($sitemap));
|
||||
|
||||
http_conditionalRequest(filemtime($sitemap));
|
||||
|
||||
|
|
|
@ -1302,7 +1302,7 @@ class JpegMeta {
|
|||
function _parseFileInfo() {
|
||||
if (file_exists($this->_fileName) && is_file($this->_fileName)) {
|
||||
$this->_info['file'] = array();
|
||||
$this->_info['file']['Name'] = utf8_decodeFN(utf8_basename($this->_fileName));
|
||||
$this->_info['file']['Name'] = utf8_decodeFN(\dokuwiki\Utf8\PhpString::basename($this->_fileName));
|
||||
$this->_info['file']['Path'] = fullpath($this->_fileName);
|
||||
$this->_info['file']['Size'] = filesize($this->_fileName);
|
||||
if ($this->_info['file']['Size'] < 1024) {
|
||||
|
@ -1393,7 +1393,7 @@ class JpegMeta {
|
|||
}
|
||||
} else {
|
||||
$this->_info['file'] = array();
|
||||
$this->_info['file']['Name'] = utf8_basename($this->_fileName);
|
||||
$this->_info['file']['Name'] = \dokuwiki\Utf8\PhpString::basename($this->_fileName);
|
||||
$this->_info['file']['Url'] = $this->_fileName;
|
||||
}
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ class Mailer {
|
|||
*/
|
||||
public function attachFile($path, $mime, $name = '', $embed = '') {
|
||||
if(!$name) {
|
||||
$name = utf8_basename($path);
|
||||
$name = \dokuwiki\Utf8\PhpString::basename($path);
|
||||
}
|
||||
|
||||
$this->attach[] = array(
|
||||
|
@ -358,7 +358,7 @@ class Mailer {
|
|||
}
|
||||
|
||||
// FIXME: is there a way to encode the localpart of a emailaddress?
|
||||
if(!utf8_isASCII($addr)) {
|
||||
if(!\dokuwiki\Utf8\Clean::isASCII($addr)) {
|
||||
msg(hsc("E-Mail address <$addr> is not ASCII"), -1);
|
||||
continue;
|
||||
}
|
||||
|
@ -374,11 +374,11 @@ class Mailer {
|
|||
$addr = "<$addr>";
|
||||
|
||||
if(defined('MAILHEADER_ASCIIONLY')) {
|
||||
$text = utf8_deaccent($text);
|
||||
$text = utf8_strip($text);
|
||||
$text = \dokuwiki\Utf8\Clean::deaccent($text);
|
||||
$text = \dokuwiki\Utf8\Clean::strip($text);
|
||||
}
|
||||
|
||||
if(strpos($text, ',') !== false || !utf8_isASCII($text)) {
|
||||
if(strpos($text, ',') !== false || !\dokuwiki\Utf8\Clean::isASCII($text)) {
|
||||
$text = '=?UTF-8?B?'.base64_encode($text).'?=';
|
||||
}
|
||||
} else {
|
||||
|
@ -524,10 +524,10 @@ class Mailer {
|
|||
if(isset($this->headers['Subject'])) {
|
||||
// add prefix to subject
|
||||
if(empty($conf['mailprefix'])) {
|
||||
if(utf8_strlen($conf['title']) < 20) {
|
||||
if(\dokuwiki\Utf8\PhpString::strlen($conf['title']) < 20) {
|
||||
$prefix = '['.$conf['title'].']';
|
||||
} else {
|
||||
$prefix = '['.utf8_substr($conf['title'], 0, 20).'...]';
|
||||
$prefix = '['.\dokuwiki\Utf8\PhpString::substr($conf['title'], 0, 20).'...]';
|
||||
}
|
||||
} else {
|
||||
$prefix = '['.$conf['mailprefix'].']';
|
||||
|
@ -539,10 +539,10 @@ class Mailer {
|
|||
|
||||
// encode subject
|
||||
if(defined('MAILHEADER_ASCIIONLY')) {
|
||||
$this->headers['Subject'] = utf8_deaccent($this->headers['Subject']);
|
||||
$this->headers['Subject'] = utf8_strip($this->headers['Subject']);
|
||||
$this->headers['Subject'] = \dokuwiki\Utf8\Clean::deaccent($this->headers['Subject']);
|
||||
$this->headers['Subject'] = \dokuwiki\Utf8\Clean::strip($this->headers['Subject']);
|
||||
}
|
||||
if(!utf8_isASCII($this->headers['Subject'])) {
|
||||
if(!\dokuwiki\Utf8\Clean::isASCII($this->headers['Subject'])) {
|
||||
$this->headers['Subject'] = '=?UTF-8?B?'.base64_encode($this->headers['Subject']).'?=';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ class SafeFN {
|
|||
* @author Christopher Smith <chris@jalakai.co.uk>
|
||||
*/
|
||||
public static function encode($filename) {
|
||||
return self::unicodeToSafe(utf8_to_unicode($filename));
|
||||
return self::unicodeToSafe(\dokuwiki\Utf8\Unicode::fromUtf8($filename));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -74,7 +74,7 @@ class SafeFN {
|
|||
* @author Christopher Smith <chris@jalakai.co.uk>
|
||||
*/
|
||||
public static function decode($filename) {
|
||||
return unicode_to_utf8(self::safeToUnicode(strtolower($filename)));
|
||||
return \dokuwiki\Utf8\Unicode::toUtf8(self::safeToUnicode(strtolower($filename)));
|
||||
}
|
||||
|
||||
public static function validatePrintableUtf8($printable_utf8) {
|
||||
|
|
|
@ -500,7 +500,7 @@ class Search extends Ui
|
|||
public function createPagenameFromQuery($parsedQuery)
|
||||
{
|
||||
$cleanedQuery = cleanID($parsedQuery['query']); // already strtolowered
|
||||
if ($cleanedQuery === utf8_strtolower($parsedQuery['query'])) {
|
||||
if ($cleanedQuery === \dokuwiki\Utf8\PhpString::strtolower($parsedQuery['query'])) {
|
||||
return ':' . $cleanedQuery;
|
||||
}
|
||||
$pagename = '';
|
||||
|
|
|
@ -42,8 +42,8 @@ class Conversion
|
|||
* are handled as well. Avoids the problem that would occur if you
|
||||
* had to decode "&#38;&amp;#38;"
|
||||
*
|
||||
* unhtmlspecialchars(utf8_unhtml($s)) -> "&&"
|
||||
* utf8_unhtml(unhtmlspecialchars($s)) -> "&&#38;"
|
||||
* unhtmlspecialchars(\dokuwiki\Utf8\Conversion::fromHtml($s)) -> "&&"
|
||||
* \dokuwiki\Utf8\Conversion::fromHtml(unhtmlspecialchars($s)) -> "&&#38;"
|
||||
* what it should be -> "&&#38;"
|
||||
*
|
||||
* @author Tom N Harris <tnharris@whoopdedo.org>
|
||||
|
|
|
@ -259,7 +259,7 @@ class PhpString
|
|||
*
|
||||
* @param string $string
|
||||
* @return string
|
||||
* @see utf8_strtoupper()
|
||||
* @see \dokuwiki\Utf8\PhpString::strtoupper()
|
||||
*
|
||||
* @author Leo Feyer <leo@typolight.org>
|
||||
* @see strtolower()
|
||||
|
@ -282,7 +282,7 @@ class PhpString
|
|||
*
|
||||
* @param string $string
|
||||
* @return string
|
||||
* @see utf8_strtoupper()
|
||||
* @see \dokuwiki\Utf8\PhpString::strtoupper()
|
||||
*
|
||||
* @author Leo Feyer <leo@typolight.org>
|
||||
* @see strtoupper()
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* range. This are lower case letters only.
|
||||
*
|
||||
* @author Andreas Gohr <andi@splitbrain.org>
|
||||
* @see utf8_deaccent()
|
||||
* @see \dokuwiki\Utf8\Clean::deaccent()
|
||||
*/
|
||||
return [
|
||||
'á' => 'a',
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
* These chars are _not_ in the array either: _ (0x5f), : 0x3a, . 0x2e, - 0x2d, * 0x2a
|
||||
*
|
||||
* @author Andreas Gohr <andi@splitbrain.org>
|
||||
* @see utf8_stripspecials()
|
||||
* @see \dokuwiki\Utf8\Clean::stripspecials()
|
||||
*/
|
||||
return [
|
||||
0x1a, //
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* range. This are upper case letters only.
|
||||
*
|
||||
* @author Andreas Gohr <andi@splitbrain.org>
|
||||
* @see utf8_deaccent()
|
||||
* @see \dokuwiki\Utf8\Clean::deaccent()
|
||||
*/
|
||||
return [
|
||||
'Á' => 'A',
|
||||
|
|
10
inc/auth.php
10
inc/auth.php
|
@ -518,7 +518,7 @@ function auth_isMember($memberlist, $user, array $groups) {
|
|||
|
||||
// clean user and groups
|
||||
if(!$auth->isCaseSensitive()) {
|
||||
$user = utf8_strtolower($user);
|
||||
$user = \dokuwiki\Utf8\PhpString::strtolower($user);
|
||||
$groups = array_map('utf8_strtolower', $groups);
|
||||
}
|
||||
$user = $auth->cleanUser($user);
|
||||
|
@ -533,7 +533,7 @@ function auth_isMember($memberlist, $user, array $groups) {
|
|||
// compare cleaned values
|
||||
foreach($members as $member) {
|
||||
if($member == '@ALL' ) return true;
|
||||
if(!$auth->isCaseSensitive()) $member = utf8_strtolower($member);
|
||||
if(!$auth->isCaseSensitive()) $member = \dokuwiki\Utf8\PhpString::strtolower($member);
|
||||
if($member[0] == '@') {
|
||||
$member = $auth->cleanGroup(substr($member, 1));
|
||||
if(in_array($member, $groups)) return true;
|
||||
|
@ -621,7 +621,7 @@ function auth_aclcheck_cb($data) {
|
|||
}
|
||||
|
||||
if(!$auth->isCaseSensitive()) {
|
||||
$user = utf8_strtolower($user);
|
||||
$user = \dokuwiki\Utf8\PhpString::strtolower($user);
|
||||
$groups = array_map('utf8_strtolower', $groups);
|
||||
}
|
||||
$user = auth_nameencode($auth->cleanUser($user));
|
||||
|
@ -648,7 +648,7 @@ function auth_aclcheck_cb($data) {
|
|||
$match = preg_replace('/#.*$/', '', $match); //ignore comments
|
||||
$acl = preg_split('/[ \t]+/', $match);
|
||||
if(!$auth->isCaseSensitive() && $acl[1] !== '@ALL') {
|
||||
$acl[1] = utf8_strtolower($acl[1]);
|
||||
$acl[1] = \dokuwiki\Utf8\PhpString::strtolower($acl[1]);
|
||||
}
|
||||
if(!in_array($acl[1], $groups)) {
|
||||
continue;
|
||||
|
@ -678,7 +678,7 @@ function auth_aclcheck_cb($data) {
|
|||
$match = preg_replace('/#.*$/', '', $match); //ignore comments
|
||||
$acl = preg_split('/[ \t]+/', $match);
|
||||
if(!$auth->isCaseSensitive() && $acl[1] !== '@ALL') {
|
||||
$acl[1] = utf8_strtolower($acl[1]);
|
||||
$acl[1] = \dokuwiki\Utf8\PhpString::strtolower($acl[1]);
|
||||
}
|
||||
if(!in_array($acl[1], $groups)) {
|
||||
continue;
|
||||
|
|
|
@ -93,7 +93,7 @@ function addLogEntry($date, $id, $type=DOKU_CHANGE_TYPE_EDIT, $summary='', $extr
|
|||
'type' => str_replace($strip, '', $type),
|
||||
'id' => $id,
|
||||
'user' => $user,
|
||||
'sum' => utf8_substr(str_replace($strip, '', $summary), 0, 255),
|
||||
'sum' => \dokuwiki\Utf8\PhpString::substr(str_replace($strip, '', $summary), 0, 255),
|
||||
'extra' => str_replace($strip, '', $extra),
|
||||
'sizechange' => $sizechange
|
||||
);
|
||||
|
@ -180,7 +180,7 @@ function addMediaLogEntry(
|
|||
'type' => str_replace($strip, '', $type),
|
||||
'id' => $id,
|
||||
'user' => $user,
|
||||
'sum' => utf8_substr(str_replace($strip, '', $summary), 0, 255),
|
||||
'sum' => \dokuwiki\Utf8\PhpString::substr(str_replace($strip, '', $summary), 0, 255),
|
||||
'extra' => str_replace($strip, '', $extra),
|
||||
'sizechange' => $sizechange
|
||||
);
|
||||
|
|
|
@ -1017,7 +1017,7 @@ function cleanText($text) {
|
|||
// if the text is not valid UTF-8 we simply assume latin1
|
||||
// this won't break any worse than it breaks with the wrong encoding
|
||||
// but might actually fix the problem in many cases
|
||||
if(!utf8_check($text)) $text = utf8_encode($text);
|
||||
if(!\dokuwiki\Utf8\Clean::isUtf8($text)) $text = utf8_encode($text);
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
@ -1167,12 +1167,12 @@ function parsePageTemplate(&$data) {
|
|||
getNS($id),
|
||||
curNS($id),
|
||||
$file,
|
||||
utf8_ucfirst($file),
|
||||
utf8_strtoupper($file),
|
||||
\dokuwiki\Utf8\PhpString::ucfirst($file),
|
||||
\dokuwiki\Utf8\PhpString::strtoupper($file),
|
||||
$page,
|
||||
utf8_ucfirst($page),
|
||||
utf8_ucwords($page),
|
||||
utf8_strtoupper($page),
|
||||
\dokuwiki\Utf8\PhpString::ucfirst($page),
|
||||
\dokuwiki\Utf8\PhpString::ucwords($page),
|
||||
\dokuwiki\Utf8\PhpString::strtoupper($page),
|
||||
$INPUT->server->str('REMOTE_USER'),
|
||||
$USERINFO['name'],
|
||||
$USERINFO['mail'],
|
||||
|
@ -1747,12 +1747,12 @@ function preg_quote_cb($string) {
|
|||
* @return string
|
||||
*/
|
||||
function shorten($keep, $short, $max, $min = 9, $char = '…') {
|
||||
$max = $max - utf8_strlen($keep);
|
||||
$max = $max - \dokuwiki\Utf8\PhpString::strlen($keep);
|
||||
if($max < $min) return $keep;
|
||||
$len = utf8_strlen($short);
|
||||
$len = \dokuwiki\Utf8\PhpString::strlen($short);
|
||||
if($len <= $max) return $keep.$short;
|
||||
$half = floor($max / 2);
|
||||
return $keep.utf8_substr($short, 0, $half - 1).$char.utf8_substr($short, $len - $half);
|
||||
return $keep.\dokuwiki\Utf8\PhpString::substr($short, 0, $half - 1).$char.\dokuwiki\Utf8\PhpString::substr($short, $len - $half);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -69,9 +69,9 @@ function sendFile($file, $mime, $dl, $cache, $public = false, $orig = null) {
|
|||
|
||||
//download or display?
|
||||
if($dl) {
|
||||
header('Content-Disposition: attachment;'.rfc2231_encode('filename', utf8_basename($orig)).';');
|
||||
header('Content-Disposition: attachment;'.rfc2231_encode('filename', \dokuwiki\Utf8\PhpString::basename($orig)).';');
|
||||
} else {
|
||||
header('Content-Disposition: inline;'.rfc2231_encode('filename', utf8_basename($orig)).';');
|
||||
header('Content-Disposition: inline;'.rfc2231_encode('filename', \dokuwiki\Utf8\PhpString::basename($orig)).';');
|
||||
}
|
||||
|
||||
//use x-sendfile header to pass the delivery to compatible webservers
|
||||
|
|
|
@ -95,7 +95,7 @@ function _ft_pageSearch(&$data) {
|
|||
);
|
||||
$evt = new Event('FULLTEXT_PHRASE_MATCH',$evdata);
|
||||
if ($evt->advise_before() && $evt->result !== true) {
|
||||
$text = utf8_strtolower($evdata['text']);
|
||||
$text = \dokuwiki\Utf8\PhpString::strtolower($evdata['text']);
|
||||
if (strpos($text, $phrase) !== false) {
|
||||
$evt->result = true;
|
||||
}
|
||||
|
@ -410,7 +410,7 @@ function ft_snippet($id,$highlight){
|
|||
$match = array();
|
||||
$snippets = array();
|
||||
$utf8_offset = $offset = $end = 0;
|
||||
$len = utf8_strlen($text);
|
||||
$len = \dokuwiki\Utf8\PhpString::strlen($text);
|
||||
|
||||
// build a regexp from the phrases to highlight
|
||||
$re1 = '(' .
|
||||
|
@ -440,8 +440,8 @@ function ft_snippet($id,$highlight){
|
|||
list($str,$idx) = $match[0];
|
||||
|
||||
// convert $idx (a byte offset) into a utf8 character offset
|
||||
$utf8_idx = utf8_strlen(substr($text,0,$idx));
|
||||
$utf8_len = utf8_strlen($str);
|
||||
$utf8_idx = \dokuwiki\Utf8\PhpString::strlen(substr($text,0,$idx));
|
||||
$utf8_len = \dokuwiki\Utf8\PhpString::strlen($str);
|
||||
|
||||
// establish context, 100 bytes surrounding the match string
|
||||
// first look to see if we can go 100 either side,
|
||||
|
@ -470,9 +470,9 @@ function ft_snippet($id,$highlight){
|
|||
$end = $utf8_idx + $utf8_len + $post; // now set it to the end of this context
|
||||
|
||||
if ($append) {
|
||||
$snippets[count($snippets)-1] .= utf8_substr($text,$append,$end-$append);
|
||||
$snippets[count($snippets)-1] .= \dokuwiki\Utf8\PhpString::substr($text,$append,$end-$append);
|
||||
} else {
|
||||
$snippets[] = utf8_substr($text,$start,$end-$start);
|
||||
$snippets[] = \dokuwiki\Utf8\PhpString::substr($text,$start,$end-$start);
|
||||
}
|
||||
|
||||
// set $offset for next match attempt
|
||||
|
@ -481,8 +481,8 @@ function ft_snippet($id,$highlight){
|
|||
// this prevents further matching of this snippet but for possible matches of length
|
||||
// smaller than match length + context (at least 50 characters) this match is part of the context
|
||||
$utf8_offset = $utf8_idx + $utf8_len;
|
||||
$offset = $idx + strlen(utf8_substr($text,$utf8_idx,$utf8_len));
|
||||
$offset = utf8_correctIdx($text,$offset);
|
||||
$offset = $idx + strlen(\dokuwiki\Utf8\PhpString::substr($text,$utf8_idx,$utf8_len));
|
||||
$offset = \dokuwiki\Utf8\Clean::correctIdx($text,$offset);
|
||||
}
|
||||
|
||||
$m = "\1";
|
||||
|
@ -672,7 +672,7 @@ function ft_queryParser($Indexer, $query){
|
|||
*/
|
||||
$parsed_query = '';
|
||||
$parens_level = 0;
|
||||
$terms = preg_split('/(-?".*?")/u', utf8_strtolower($query), -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
|
||||
$terms = preg_split('/(-?".*?")/u', \dokuwiki\Utf8\PhpString::strtolower($query), -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
|
||||
|
||||
foreach ($terms as $term) {
|
||||
$parsed = '';
|
||||
|
|
|
@ -355,7 +355,7 @@ function html_hilight($html,$phrases){
|
|||
$regex = join('|',$phrases);
|
||||
|
||||
if ($regex === '') return $html;
|
||||
if (!utf8_check($regex)) return $html;
|
||||
if (!\dokuwiki\Utf8\Clean::isUtf8($regex)) return $html;
|
||||
$html = @preg_replace_callback("/((<[^>]*)|$regex)/ui",'html_hilight_callback',$html);
|
||||
return $html;
|
||||
}
|
||||
|
|
|
@ -605,12 +605,12 @@ class Doku_Indexer {
|
|||
)
|
||||
);
|
||||
if (preg_match('/[^0-9A-Za-z ]/u', $text))
|
||||
$text = utf8_stripspecials($text, ' ', '\._\-:'.$wc);
|
||||
$text = \dokuwiki\Utf8\Clean::stripspecials($text, ' ', '\._\-:'.$wc);
|
||||
|
||||
$wordlist = explode(' ', $text);
|
||||
foreach ($wordlist as $i => $word) {
|
||||
$wordlist[$i] = (preg_match('/[^0-9A-Za-z]/u', $word)) ?
|
||||
utf8_strtolower($word) : strtolower($word);
|
||||
\dokuwiki\Utf8\PhpString::strtolower($word) : strtolower($word);
|
||||
}
|
||||
|
||||
foreach ($wordlist as $i => $word) {
|
||||
|
@ -1603,7 +1603,7 @@ function idx_indexLengths($filter) {
|
|||
* @return string
|
||||
*/
|
||||
function idx_cleanName($name) {
|
||||
$name = utf8_romanize(trim((string)$name));
|
||||
$name = \dokuwiki\Utf8\Clean::romanize(trim((string)$name));
|
||||
$name = preg_replace('#[ \./\\:-]+#', '_', $name);
|
||||
$name = preg_replace('/[^A-Za-z0-9_]/', '', $name);
|
||||
return strtolower($name);
|
||||
|
|
|
@ -345,7 +345,7 @@ function msg($message,$lvl=0,$line='',$file='',$allow=MSG_PUBLIC){
|
|||
$errors[1] = 'success';
|
||||
$errors[2] = 'notify';
|
||||
|
||||
if($line || $file) $message.=' ['.utf8_basename($file).':'.$line.']';
|
||||
if($line || $file) $message.=' ['.\dokuwiki\Utf8\PhpString::basename($file).':'.$line.']';
|
||||
|
||||
if(!isset($MSG)) $MSG = array();
|
||||
$MSG[]=array('lvl' => $errors[$lvl], 'msg' => $message, 'allow' => $allow);
|
||||
|
|
|
@ -623,7 +623,7 @@ function io_download($url,$file,$useAttachment=false,$defaultName='',$maxSize=20
|
|||
if (is_string($content_disposition) &&
|
||||
preg_match('/attachment;\s*filename\s*=\s*"([^"]*)"/i', $content_disposition, $match)) {
|
||||
|
||||
$name = utf8_basename($match[1]);
|
||||
$name = \dokuwiki\Utf8\PhpString::basename($match[1]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
14
inc/mail.php
14
inc/mail.php
|
@ -134,11 +134,11 @@ function _mail_send_action($data) {
|
|||
// end additional code to support event ... original mail_send() code from here
|
||||
|
||||
if(defined('MAILHEADER_ASCIIONLY')){
|
||||
$subject = utf8_deaccent($subject);
|
||||
$subject = utf8_strip($subject);
|
||||
$subject = \dokuwiki\Utf8\Clean::deaccent($subject);
|
||||
$subject = \dokuwiki\Utf8\Clean::strip($subject);
|
||||
}
|
||||
|
||||
if(!utf8_isASCII($subject)) {
|
||||
if(!\dokuwiki\Utf8\Clean::isASCII($subject)) {
|
||||
$enc_subj = '=?UTF-8?Q?'.mail_quotedprintable_encode($subject,0).'?=';
|
||||
// Spaces must be encoded according to rfc2047. Use the "_" shorthand
|
||||
$enc_subj = preg_replace('/ /', '_', $enc_subj);
|
||||
|
@ -212,7 +212,7 @@ function mail_encode_address($string,$header='',$names=true){
|
|||
}
|
||||
|
||||
// FIXME: is there a way to encode the localpart of a emailaddress?
|
||||
if(!utf8_isASCII($addr)){
|
||||
if(!\dokuwiki\Utf8\Clean::isASCII($addr)){
|
||||
msg(hsc("E-Mail address <$addr> is not ASCII"),-1);
|
||||
continue;
|
||||
}
|
||||
|
@ -228,11 +228,11 @@ function mail_encode_address($string,$header='',$names=true){
|
|||
$addr = "<$addr>";
|
||||
|
||||
if(defined('MAILHEADER_ASCIIONLY')){
|
||||
$text = utf8_deaccent($text);
|
||||
$text = utf8_strip($text);
|
||||
$text = \dokuwiki\Utf8\Clean::deaccent($text);
|
||||
$text = \dokuwiki\Utf8\Clean::strip($text);
|
||||
}
|
||||
|
||||
if(!utf8_isASCII($text)){
|
||||
if(!\dokuwiki\Utf8\Clean::isASCII($text)){
|
||||
// put the quotes outside as in =?UTF-8?Q?"Elan Ruusam=C3=A4e"?= vs "=?UTF-8?Q?Elan Ruusam=C3=A4e?="
|
||||
if (preg_match('/^"(.+)"$/', $text, $matches)) {
|
||||
$text = '"=?UTF-8?Q?'.mail_quotedprintable_encode($matches[1], 0).'?="';
|
||||
|
|
|
@ -261,7 +261,7 @@ function media_delete($id,$auth){
|
|||
// trigger an event - MEDIA_DELETE_FILE
|
||||
$data = array();
|
||||
$data['id'] = $id;
|
||||
$data['name'] = utf8_basename($file);
|
||||
$data['name'] = \dokuwiki\Utf8\PhpString::basename($file);
|
||||
$data['path'] = $file;
|
||||
$data['size'] = (file_exists($file)) ? filesize($file) : 0;
|
||||
|
||||
|
@ -1762,7 +1762,7 @@ function media_printimgdetail($item, $fullscreen=false){
|
|||
$d = $item['meta']->getField(array('IPTC.Caption','EXIF.UserComment',
|
||||
'EXIF.TIFFImageDescription',
|
||||
'EXIF.TIFFUserComment'));
|
||||
if(utf8_strlen($d) > 250) $d = utf8_substr($d,0,250).'...';
|
||||
if(\dokuwiki\Utf8\PhpString::strlen($d) > 250) $d = \dokuwiki\Utf8\PhpString::substr($d,0,250).'...';
|
||||
$k = $item['meta']->getField(array('IPTC.Keywords','IPTC.Category','xmp.dc:subject'));
|
||||
|
||||
// print EXIF/IPTC data
|
||||
|
|
|
@ -44,7 +44,7 @@ function getID($param='id',$clean=true){
|
|||
if($param != 'id') {
|
||||
$relpath = 'lib/exe/';
|
||||
}
|
||||
$script = $conf['basedir'].$relpath.utf8_basename($INPUT->server->str('SCRIPT_FILENAME'));
|
||||
$script = $conf['basedir'].$relpath.\dokuwiki\Utf8\PhpString::basename($INPUT->server->str('SCRIPT_FILENAME'));
|
||||
|
||||
}elseif($INPUT->server->str('PATH_INFO')){
|
||||
$request = $INPUT->server->str('PATH_INFO');
|
||||
|
@ -127,7 +127,7 @@ function cleanID($raw_id,$ascii=false){
|
|||
$sepcharpat = '#\\'.$sepchar.'+#';
|
||||
|
||||
$id = trim((string)$raw_id);
|
||||
$id = utf8_strtolower($id);
|
||||
$id = \dokuwiki\Utf8\PhpString::strtolower($id);
|
||||
|
||||
//alternative namespace seperator
|
||||
if($conf['useslash']){
|
||||
|
@ -136,13 +136,13 @@ function cleanID($raw_id,$ascii=false){
|
|||
$id = strtr($id,';/',':'.$sepchar);
|
||||
}
|
||||
|
||||
if($conf['deaccent'] == 2 || $ascii) $id = utf8_romanize($id);
|
||||
if($conf['deaccent'] || $ascii) $id = utf8_deaccent($id,-1);
|
||||
if($conf['deaccent'] == 2 || $ascii) $id = \dokuwiki\Utf8\Clean::romanize($id);
|
||||
if($conf['deaccent'] || $ascii) $id = \dokuwiki\Utf8\Clean::deaccent($id,-1);
|
||||
|
||||
//remove specials
|
||||
$id = utf8_stripspecials($id,$sepchar,'\*');
|
||||
$id = \dokuwiki\Utf8\Clean::stripspecials($id,$sepchar,'\*');
|
||||
|
||||
if($ascii) $id = utf8_strip($id);
|
||||
if($ascii) $id = \dokuwiki\Utf8\Clean::strip($id);
|
||||
|
||||
//clean up
|
||||
$id = preg_replace($sepcharpat,$sepchar,$id);
|
||||
|
|
|
@ -21,8 +21,8 @@ class Doku_Renderer_code extends Doku_Renderer {
|
|||
if(!$language) $language = 'txt';
|
||||
$language = preg_replace(PREG_PATTERN_VALID_LANGUAGE, '', $language);
|
||||
if(!$filename) $filename = 'snippet.'.$language;
|
||||
$filename = utf8_basename($filename);
|
||||
$filename = utf8_stripspecials($filename, '_');
|
||||
$filename = \dokuwiki\Utf8\PhpString::basename($filename);
|
||||
$filename = \dokuwiki\Utf8\Clean::stripspecials($filename, '_');
|
||||
|
||||
// send CRLF to Windows clients
|
||||
if(strpos($INPUT->server->str('HTTP_USER_AGENT'), 'Windows') !== false) {
|
||||
|
|
|
@ -93,7 +93,7 @@ class Doku_Renderer_metadata extends Doku_Renderer
|
|||
// cut off too long abstracts
|
||||
$this->doc = trim($this->doc);
|
||||
if (strlen($this->doc) > self::ABSTRACT_MAX) {
|
||||
$this->doc = utf8_substr($this->doc, 0, self::ABSTRACT_MAX).'…';
|
||||
$this->doc = \dokuwiki\Utf8\PhpString::substr($this->doc, 0, self::ABSTRACT_MAX).'…';
|
||||
}
|
||||
$this->meta['description']['abstract'] = $this->doc;
|
||||
}
|
||||
|
|
|
@ -1639,7 +1639,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
|
|||
// return the title of the picture
|
||||
if(!$title) {
|
||||
// just show the sourcename
|
||||
$title = $this->_xmlEntities(utf8_basename(noNS($src)));
|
||||
$title = $this->_xmlEntities(\dokuwiki\Utf8\PhpString::basename(noNS($src)));
|
||||
}
|
||||
return $title;
|
||||
}
|
||||
|
@ -1675,7 +1675,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
|
|||
if(!$render) {
|
||||
// if the file is not supposed to be rendered
|
||||
// return the title of the file (just the sourcename if there is no title)
|
||||
return $title ? $title : $this->_xmlEntities(utf8_basename(noNS($src)));
|
||||
return $title ? $title : $this->_xmlEntities(\dokuwiki\Utf8\PhpString::basename(noNS($src)));
|
||||
}
|
||||
|
||||
$att = array();
|
||||
|
@ -1699,7 +1699,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
|
|||
// return the title of the flash
|
||||
if(!$title) {
|
||||
// just show the sourcename
|
||||
$title = utf8_basename(noNS($src));
|
||||
$title = \dokuwiki\Utf8\PhpString::basename(noNS($src));
|
||||
}
|
||||
return $this->_xmlEntities($title);
|
||||
}
|
||||
|
@ -1720,7 +1720,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
|
|||
$ret .= $this->_xmlEntities($title);
|
||||
} else {
|
||||
// just show the sourcename
|
||||
$ret .= $this->_xmlEntities(utf8_basename(noNS($src)));
|
||||
$ret .= $this->_xmlEntities(\dokuwiki\Utf8\PhpString::basename(noNS($src)));
|
||||
}
|
||||
|
||||
return $ret;
|
||||
|
@ -1882,7 +1882,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
|
|||
$url = ml($file, '', true, '&');
|
||||
$linkType = 'internalmedia';
|
||||
}
|
||||
$title = $atts['title'] ? $atts['title'] : $this->_xmlEntities(utf8_basename(noNS($file)));
|
||||
$title = $atts['title'] ? $atts['title'] : $this->_xmlEntities(\dokuwiki\Utf8\PhpString::basename(noNS($file)));
|
||||
|
||||
$out .= '<source src="'.hsc($url).'" type="'.$mime.'" />'.NL;
|
||||
// alternative content (just a link to the file)
|
||||
|
@ -1949,7 +1949,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
|
|||
$url = ml($file, '', true, '&');
|
||||
$linkType = 'internalmedia';
|
||||
}
|
||||
$title = $atts['title'] ? $atts['title'] : $this->_xmlEntities(utf8_basename(noNS($file)));
|
||||
$title = $atts['title'] ? $atts['title'] : $this->_xmlEntities(\dokuwiki\Utf8\PhpString::basename(noNS($file)));
|
||||
|
||||
$out .= '<source src="'.hsc($url).'" type="'.$mime.'" />'.NL;
|
||||
// alternative content (just a link to the file)
|
||||
|
|
|
@ -211,7 +211,7 @@ function search_media(&$data,$base,$file,$type,$lvl,$opts){
|
|||
return false;
|
||||
}
|
||||
|
||||
$info['file'] = utf8_basename($file);
|
||||
$info['file'] = \dokuwiki\Utf8\PhpString::basename($file);
|
||||
$info['size'] = filesize($base.'/'.$file);
|
||||
$info['mtime'] = filemtime($base.'/'.$file);
|
||||
$info['writable'] = is_writable($base.'/'.$file);
|
||||
|
@ -497,7 +497,7 @@ function search_universal(&$data,$base,$file,$type,$lvl,$opts){
|
|||
$item['open'] = $return;
|
||||
|
||||
if(!empty($opts['meta'])){
|
||||
$item['file'] = utf8_basename($file);
|
||||
$item['file'] = \dokuwiki\Utf8\PhpString::basename($file);
|
||||
$item['size'] = filesize($base.'/'.$file);
|
||||
$item['mtime'] = filemtime($base.'/'.$file);
|
||||
$item['rev'] = $item['mtime'];
|
||||
|
|
|
@ -233,7 +233,7 @@ if (!function_exists('utf8_to_unicode')) {
|
|||
/** @deprecated 2019-06-09 */
|
||||
function utf8_to_unicode($str, $strict = false)
|
||||
{
|
||||
dbg_deprecated(Conversion::class . '::fromUtf8()');
|
||||
dbg_deprecated(Unicode::class . '::fromUtf8()');
|
||||
return Unicode::fromUtf8($str, $strict);
|
||||
}
|
||||
}
|
||||
|
@ -242,7 +242,7 @@ if (!function_exists('unicode_to_utf8')) {
|
|||
/** @deprecated 2019-06-09 */
|
||||
function unicode_to_utf8($arr, $strict = false)
|
||||
{
|
||||
dbg_deprecated(Conversion::class . '::toUtf8()');
|
||||
dbg_deprecated(Unicode::class . '::toUtf8()');
|
||||
return Unicode::toUtf8($arr, $strict);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -176,7 +176,7 @@ function js_load($file){
|
|||
|
||||
// is it a include_once?
|
||||
if($match[1]){
|
||||
$base = utf8_basename($ifile);
|
||||
$base = \dokuwiki\Utf8\PhpString::basename($ifile);
|
||||
if(array_key_exists($base, $loaded) && $loaded[$base] === true){
|
||||
$data = str_replace($match[0], '' ,$data);
|
||||
continue;
|
||||
|
|
|
@ -101,7 +101,7 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin
|
|||
// make sure the right encoding is used
|
||||
if ($this->getConf('sso_charset')) {
|
||||
$_SERVER['REMOTE_USER'] = iconv($this->getConf('sso_charset'), 'UTF-8', $_SERVER['REMOTE_USER']);
|
||||
} elseif (!utf8_check($_SERVER['REMOTE_USER'])) {
|
||||
} elseif (!\dokuwiki\Utf8\Clean::isUtf8($_SERVER['REMOTE_USER'])) {
|
||||
$_SERVER['REMOTE_USER'] = utf8_encode($_SERVER['REMOTE_USER']);
|
||||
}
|
||||
|
||||
|
@ -297,7 +297,7 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin
|
|||
$group = str_replace('\\', '', $group);
|
||||
$group = str_replace('#', '', $group);
|
||||
$group = preg_replace('[\s]', '_', $group);
|
||||
$group = utf8_strtolower(trim($group));
|
||||
$group = \dokuwiki\Utf8\PhpString::strtolower(trim($group));
|
||||
return $group;
|
||||
}
|
||||
|
||||
|
@ -322,8 +322,8 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin
|
|||
if ($dom) $domain = $dom;
|
||||
|
||||
// clean up both
|
||||
$domain = utf8_strtolower(trim($domain));
|
||||
$user = utf8_strtolower(trim($user));
|
||||
$domain = \dokuwiki\Utf8\PhpString::strtolower(trim($domain));
|
||||
$user = \dokuwiki\Utf8\PhpString::strtolower(trim($user));
|
||||
|
||||
// is this a known, valid domain? if not discard
|
||||
if (!is_array($this->conf[$domain])) {
|
||||
|
|
|
@ -913,7 +913,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin
|
|||
if (is_string($content_disposition) &&
|
||||
preg_match('/attachment;\s*filename\s*=\s*"([^"]*)"/i', $content_disposition, $match)) {
|
||||
|
||||
$name = utf8_basename($match[1]);
|
||||
$name = \dokuwiki\Utf8\PhpString::basename($match[1]);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -953,7 +953,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin
|
|||
if (is_null($file)) {
|
||||
$file = md5($url);
|
||||
} else {
|
||||
$file = utf8_basename($file);
|
||||
$file = \dokuwiki\Utf8\PhpString::basename($file);
|
||||
}
|
||||
|
||||
// create tmp directory for download
|
||||
|
|
|
@ -1080,7 +1080,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin
|
|||
$fd = fopen($_FILES['import']['tmp_name'], 'r');
|
||||
if ($fd) {
|
||||
while ($csv = fgets($fd)) {
|
||||
if (!utf8_check($csv)) {
|
||||
if (!\dokuwiki\Utf8\Clean::isUtf8($csv)) {
|
||||
$csv = utf8_encode($csv);
|
||||
}
|
||||
$raw = str_getcsv($csv);
|
||||
|
|
Loading…
Reference in New Issue