[php-transmission-class] r13 committed - Changed MIN_PHPVER from 5.0.0 to 5.2.10. Applied deadeyes cleanrequest...

0 views
Skip to first unread message

php-transmi...@googlecode.com

unread,
Jul 22, 2010, 4:49:55 AM7/22/10
to php-transmi...@googlegroups.com
Revision: 13
Author: johan.adriaans
Date: Thu Jul 22 01:49:01 2010
Log: Changed MIN_PHPVER from 5.0.0 to 5.2.10. Applied deadeyes
cleanrequestdata fix
http://code.google.com/p/php-transmission-class/source/detail?r=13

Modified:
/trunk/class/TransmissionRPC.class.php

=======================================
--- /trunk/class/TransmissionRPC.class.php Fri Jul 9 19:29:06 2010
+++ /trunk/class/TransmissionRPC.class.php Thu Jul 22 01:49:01 2010
@@ -51,8 +51,9 @@

/**
* Minimum PHP version required
+ * 5.2.10 implemented the required http stream ignore_errors option
*/
- const MIN_PHPVER = '5.0.0';
+ const MIN_PHPVER = '5.2.10';

/**
* The URL to the bittorent client you want to communicate with
@@ -345,7 +346,7 @@
{
if( is_object( $value ) ) $array[$index] = $value->toArray(); //
Convert objects to arrays so they can be JSON encoded
if( is_array( $value ) ) $array[$index] = $this->cleanRequestData(
$value ); // Recursion
- if( empty( $value ) ) unset( $array[$index] ); // Remove empty
members
+ if( empty( $value ) && $value != 0 ) unset( $array[$index] ); //
Remove empty members
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

Reply all
Reply to author
Forward
0 new messages