diff --git a/iTunesXMLparser.class.php b/iTunesXMLparser.class.php index 08dc1d1..27a48a5 100644 --- a/iTunesXMLparser.class.php +++ b/iTunesXMLparser.class.php @@ -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 ) ) {