mirror of
				https://github.com/nerzhul/ocsms.git
				synced 2025-10-28 00:49:11 +00:00 
			
		
		
		
	Testing boolean modif for draft field
This commit is contained in:
		
							parent
							
								
									3096f44293
								
							
						
					
					
						commit
						c089cc3ded
					
				| @ -57,7 +57,7 @@ class SmsController extends Controller { | ||||
| 			return false; | ||||
| 		} | ||||
| 
 | ||||
| 		foreach ($smsDatas as $sms) { | ||||
| 		foreach ($smsDatas as &$sms) { | ||||
| 			if (!array_key_exists("id", $sms) || !array_key_exists("read", $sms) || | ||||
| 				!array_key_exists("draft", $sms) || | ||||
| 				!array_key_exists("date", $sms) || !array_key_exists("seen", $sms) || | ||||
| @ -85,6 +85,9 @@ class SmsController extends Controller { | ||||
| 				$this->errorMsg = "Error: Invalid SMS Draft state"; | ||||
| 				return false; | ||||
| 			} | ||||
| 			else { | ||||
| 				$sms["draft"] == $sms["draft"] === true; | ||||
| 			} | ||||
| 
 | ||||
| 			if (!is_numeric($sms["date"]) && $sms["date"] != 0 && $sms["date"] != 1) { | ||||
| 				$this->errorMsg = "Error: Invalid SMS date"; | ||||
|  | ||||
| @ -30,7 +30,7 @@ class SmsMapper extends Mapper { | ||||
| 			$result = $query->execute(array( | ||||
| 				$userId, "NOW()", "NOW()", | ||||
| 				$sms["read"] === "true", $sms["seen"] === "true", | ||||
| 				(int) $sms["date"], $sms["draft"] === "true", $sms["id"], | ||||
| 				(int) $sms["date"], $sms["draft"], (int) $sms["id"], | ||||
| 				$sms["address"], $sms["body"] | ||||
| 			)); | ||||
| 		} | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user