Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter GMax24

    (@gmax24)

    Sorry, mistyped attribute name.

    Short lived url it’s what I need, but specific user involved breaks the idea.

    OK.

    Thread Starter GMax24

    (@gmax24)

    THANK YOU 🙂

    Thread Starter GMax24

    (@gmax24)

    comma, :^)
    Yes, this is NOT File Away BUG, but it is File Away ISSUE because of using WIDELY KNOWN BUGgy php function (above seven years!)

    once more: note – I’m not use setlocale() inside apache, apache have standard C locale.
    and once more: it’s not file-related problem, it’s character related problem. and it take place with non-utf characters too.
    and it’s EASY fixable by one preg_match() instead of pathinfo() in your code. (unlike universal function I suggested above)

    btw, thanks for new version, anyway I can fix it for myself now…

    Thread Starter GMax24

    (@gmax24)

    OK. this means “Won’tFix” because author don’t need it

    Thread Starter GMax24

    (@gmax24)

    where I can find this snippet ?

    Thread Starter GMax24

    (@gmax24)

    >>As I have long said, you need to use language-pack keyboards for your special characters, not utf8 characters

    what relation the keyboard has to the filesystem-related file name encoding ?
    any modern linux OS have “xx_XX.UTF8” encoding as default.

    and if anyone need to display files, it’s returned by the OS without any keyboard interaction 🙂
    setlocale() in PHP it’s a bad thing and most easy way – it to fix related buggy finction. without ANY relation to utf or unicode.
    I publish some example above. may I suggest another ?

    class UTF
    {
        public static $ON = false;
    
        static public function pathinfo($path_file, $options = NULL)
        {
    	if (self::$ON) {
    		$path_file = strtr($path_file,array('\\'=>'/'));
    
    		preg_match("~[^/]+$~",$path_file,$file);
    		preg_match("~([^/]+)[.$]+(.*)~",$file[0],$file_ext);
    		preg_match("~(.*)[/$]+~",$path_file,$dirname);
    		if (!$dirname[1]) $dirname[1]='.';
    
    		$result = array('dirname' => $dirname[1],
    			'basename' => $file[0],
    			'extension' => (isset($file_ext[2]))?$file_ext[2]:false,
    			'filename' => (isset($file_ext[1]))?$file_ext[1]:$file[0]
    		);
    		if ($options & PATHINFO_DIRNAME) return $result['dirname'];
    		if ($options & PATHINFO_BASENAME) return $result['basename'];
    		if ($options & PATHINFO_EXTENSION) return $result['extension'];
    		if ($options & PATHINFO_FILENAME) return $result['filename'];
    		return $result;
    	}
    	else {
    		if ($options) return pathinfo($path_file, $options);
    		else return pathinfo($path_file);
    	}
        }
    }

    it performance impact are small for OFF state and if anyone need it, just need to execute UTF::$ON=true thru plugin options

Viewing 6 replies - 1 through 6 (of 6 total)