@@ -113,29 +113,16 @@ public function callback($m)
113113 private function formatValue ($ value , $ mode = NULL )
114114 {
115115 if (!$ mode || $ mode === 'auto ' ) {
116- if (is_string ($ value )) {
117- if (strlen ($ value ) > 20 ) {
118- $ this ->remaining [] = $ value ;
119- return '? ' ;
120-
121- } else {
122- return $ this ->connection ->quote ($ value );
123- }
124-
125- } elseif (is_int ($ value )) {
126- return (string ) $ value ;
127-
128- } elseif (is_float ($ value )) {
129- return rtrim (rtrim (number_format ($ value , 10 , '. ' , '' ), '0 ' ), '. ' );
130-
131- } elseif (is_bool ($ value )) {
132- return $ this ->driver ->formatBool ($ value );
116+ if (is_scalar ($ value ) || is_resource ($ value )) {
117+ $ this ->remaining [] = $ value ;
118+ return '? ' ;
133119
134120 } elseif ($ value === NULL ) {
135121 return 'NULL ' ;
136122
137123 } elseif ($ value instanceof Table \IRow) {
138- return $ this ->formatValue ($ value ->getPrimary ());
124+ $ this ->remaining [] = $ value ->getPrimary ();
125+ return '? ' ;
139126
140127 } elseif ($ value instanceof SqlLiteral) {
141128 $ prep = clone $ this ;
@@ -150,10 +137,7 @@ private function formatValue($value, $mode = NULL)
150137 return $ this ->driver ->formatDateInterval ($ value );
151138
152139 } elseif (is_object ($ value ) && method_exists ($ value , '__toString ' )) {
153- return $ this ->formatValue ((string ) $ value );
154-
155- } elseif (is_resource ($ value )) {
156- $ this ->remaining [] = $ value ;
140+ $ this ->remaining [] = (string ) $ value ;
157141 return '? ' ;
158142 }
159143
0 commit comments