Projeto

Geral

Perfil

calendar_qry_quote.patch

Mauricio Luiz Viani, 22/03/2019 14:49 h

Baixar (1,14 KB)

Ver diferenças:

calendar/inc/class.socalendar_sql.inc.php
938 938
			return ( count( $arr ) === 0 )? false : ( ($prefix !== false)? $prefix.' ': '' ).implode( $glue, $this->qry_filter( $arr ) );
939 939
		}
940 940

  
941
		protected function qry_quote( $param )
941
		// This method is public for PHP 5.3 compatibility
942
		// Should be protected for PHP >= 5.6
943
		public function qry_quote( $param )
942 944
		{
945
			$classParent = $this;
946

  
947
			$functionArrayReduce = function( $c, $i ) use( $classParent ) { 
948
				$c[] = $classParent->qry_quote( $i ); 
949
				return $c; 
950
			};
951

  
943 952
			if ( is_string( $param ) ) return '\''.$param.'\'';
944 953
			if ( is_int( $param    ) ) return $param;
945
			return implode( ', ', array_reduce( $param, function( $c, $i ){ $c[] = $this->qry_quote( $i ); return $c; }, array() ) );
954
			return implode( ', ', array_reduce( $param, $functionArrayReduce , array() ) );
946 955
		}
947 956

  
948 957
		function save_event( &$event )