Skip to content
This repository has been archived by the owner on Apr 23, 2022. It is now read-only.

Commit

Permalink
- fix original #14 #14
Browse files Browse the repository at this point in the history
  • Loading branch information
drj7z authored and brycied00d committed Oct 19, 2016
1 parent aeeb843 commit 46d67b3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion class/TransmissionRPC.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,12 @@ protected function cleanRequestData ( $array )
}
if( is_numeric( $value ) ) $array[$index] = $value+0; // Force type-casting for proper JSON encoding (+0 is a cheap way to maintain int/float/etc)
if( is_bool( $value ) ) $array[$index] = ( $value ? 1 : 0); // Store boolean values as 0 or 1
if( is_string( $value ) ) $array[$index] = utf8_encode( $value ); // Make sure all data is UTF-8 encoded for Transmission
if( is_string( $value ) ) {
if ( mb_detect_encoding($value,"auto") !== 'UTF-8' ) {
$array[$index] = mb_convert_encoding($value, "UTF-8");
//utf8_encode( $value ); // Make sure all data is UTF-8 encoded for Transmission
}
}
}
return $array;
}
Expand Down

0 comments on commit 46d67b3

Please sign in to comment.