LiteSpeed Support Forums

LiteSpeed Support Forums (http://www.litespeedtech.com/support/forum/index.php)
-   Bug Reports (http://www.litespeedtech.com/support/forum/forumdisplay.php?f=9)
-   -   [RESOLVED] autoindex size bug (http://www.litespeedtech.com/support/forum/showthread.php?t=3859)

justme 03-09-2010 08:11 AM

[RESOLVED] autoindex size bug
 
Hello,
using lsws standard 4.0.13 on linux, autoindex can't display file sizes above 2GB (unsigned int), it shows negatives or wrapped numbers instead.

justme 03-09-2010 09:03 AM

Fixed by replacing line 161 of /usr/local/lsws/share/autoindex/default.php
with
$fileStat->size = (float) exec('stat -c %s '.escapeshellarg("$path$file"));

mistwang 03-10-2010 07:38 AM

You can try
$fileStat->size = sprintf("%u", $s[7]);

it limit to 4GB due to PHP limits on 32bit system.

justme 03-10-2010 07:41 AM

Actually my solution works except for one thing, utf-8 named files. It is also broken when browsing so it is not only related to file sizes.
Do you have a recommended php configuration? I tried to force the location to define default charset as utf-8 but it doesn't work (content-type does not contain charset).

justme 03-11-2010 05:09 AM

I got it all working with adding
<meta http-equiv=\"Content-type\" content=\"text/html; charset=UTF-8\"/>

and fixing:
$uri = htmlentities($uri,ENT_COMPAT,"UTF-8");

$fileStat->size = 512*$s[12]; (works for files <2TB in size :D)

mistwang 03-11-2010 07:56 PM

Thanks for the fix, we will apply the change to next release.


All times are GMT -7. The time now is 07:59 AM.