Skip to content

Commit 2d18023

Browse files
committed
Fix 'Illegal string offset' problem with mpd 0.18
1 parent 27e30c0 commit 2d18023

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

info.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ function getLsInfo( $conn, $command, $display_fields )
411411
case "directory":
412412
$type = "directory";
413413
$dcount++;
414-
$dir[$dcount] = str_replace( "$el: " , "", $got );
414+
$dir[$dcount][$el] = str_replace( "$el: " , "", $got );
415415
break;
416416
case "playlist":
417417
$type = "playlist";

info2html.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ function lsinfo2directoryTable( $lsinfo, $server, $sort, $addperm, $color )
1818
$count = count( $lsinfo );
1919
if( $count != "0" )
2020
{
21-
usort( $lsinfo, "strcasecmp" );
21+
usort( $lsinfo, "dsort" );
2222
}
2323

2424
$dic = 0;
2525
$index=array();
2626
for( $i = "0"; $i < $count; $i++ )
2727
{
28-
$dirstr = basename( $lsinfo[$i] );
29-
$full_dir = rawurlencode( $lsinfo[$i] );
28+
$dirstr = basename( $lsinfo[$i]["directory"] );
29+
$full_dir = rawurlencode( $lsinfo[$i]["directory"] );
3030
$print[$i] = "<tr bgcolor=\"{$color[ ($i%2) ]}\"><td>";
3131
$fc = strtoupper( mbFirstChar( $dirstr ));
3232
if ($dic == "0" || $index[ ($dic-1) ]!=$fc)

sort.php

100755100644
+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
<?php
2+
function dsort( $a, $b )
3+
{
4+
return strcasecmp( basename( $a["directory"] ), basename( $b["directory"] ) );
5+
}
6+
27
function fsort( $a, $b )
38
{
49
return strcasecmp( basename( $a["file"] ), basename( $b["file"] ) );

0 commit comments

Comments
 (0)