Skip to content

Commit

Permalink
Changed broken array access
Browse files Browse the repository at this point in the history
  • Loading branch information
dajoho committed Jul 11, 2019
1 parent 797d3c4 commit eb28d8a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions iTunesXMLparser.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,20 +115,19 @@ public function processPlaylists() {

// To be used with the uasort() array function
protected function sort( $left, $right ) {

$field = $this->sort_field;
$direction = $this->sort_direction;

if ( !isset( $left[ $field ] ) ) {
if ( !isset( $left->$field ) ) {
return 1;
}
elseif ( !isset( $right[ $field ] ) ) {
elseif ( !isset( $right->$field ) ) {
return -1;
}

// Return the strcmp() of the two fields
$left = $left[ $field ];
$right = $right[ $field ];
$left = $left->$field;
$right = $right->$field;

switch ( gettype( $left ) ) {

Expand Down

0 comments on commit eb28d8a

Please sign in to comment.