Bugfix for pictures that weren't stored / reworked database calls
This commit is contained in:
		
					parent
					
						
							
								40fa941518
							
						
					
				
			
			
				commit
				
					
						6d7ececc42
					
				
			
		
					 12 changed files with 64 additions and 223 deletions
				
			
		| 
						 | 
				
			
			@ -1400,37 +1400,6 @@ function qu($sql) {
 | 
			
		|||
	return false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 *
 | 
			
		||||
 * Raw db query, no arguments
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
function dbq($sql) {
 | 
			
		||||
	global $db;
 | 
			
		||||
 | 
			
		||||
	if ($db && $db->connected) {
 | 
			
		||||
		$ret = $db->q($sql);
 | 
			
		||||
	} else {
 | 
			
		||||
		$ret = false;
 | 
			
		||||
	}
 | 
			
		||||
	return $ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Caller is responsible for ensuring that any integer arguments to
 | 
			
		||||
// dbesc_array are actually integers and not malformed strings containing
 | 
			
		||||
// SQL injection vectors. All integer array elements should be specifically
 | 
			
		||||
// cast to int to avoid trouble.
 | 
			
		||||
function dbesc_array_cb(&$item, $key) {
 | 
			
		||||
	if (is_string($item))
 | 
			
		||||
		$item = dbesc($item);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function dbesc_array(&$arr) {
 | 
			
		||||
	if (is_array($arr) && count($arr)) {
 | 
			
		||||
		array_walk($arr,'dbesc_array_cb');
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function dba_timer() {
 | 
			
		||||
	return microtime(true);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue