[Advanced search] Only run a query which contains select, but not delete or update. Done for safety precautions.
这个提交包含在:
		
							父节点
							
								
									0717fa74ff
								
							
						
					
					
						当前提交
						17170433e0
					
				
					共有  1 个文件被更改,包括 5 次插入 和 2 次删除
				
			
		|  | @ -88,11 +88,14 @@ class Search extends CI_Controller { | ||||||
| 	function run_query() { | 	function run_query() { | ||||||
| 		$this->db->where('id', xss_clean($this->input->post('id'))); | 		$this->db->where('id', xss_clean($this->input->post('id'))); | ||||||
| 		$sql = $this->db->get('queries')->result(); | 		$sql = $this->db->get('queries')->result(); | ||||||
|  | 		$sql = $sql[0]->query; | ||||||
| 
 | 
 | ||||||
| 		$data['results'] = $this->db->query($sql[0]->query); | 		if (stristr($sql, 'select', ) && !stristr($sql, 'delete') && !stristr($sql, 'update')) { | ||||||
|  | 			$data['results'] = $this->db->query($sql); | ||||||
| 
 | 
 | ||||||
| 			$this->load->view('search/search_result_ajax', $data); | 			$this->load->view('search/search_result_ajax', $data); | ||||||
| 		} | 		} | ||||||
|  | 	} | ||||||
| 
 | 
 | ||||||
| 	function save_query() { | 	function save_query() { | ||||||
| 		if(isset($_POST['search'])) { | 		if(isset($_POST['search'])) { | ||||||
|  |  | ||||||
		正在加载…
	
		在新工单中引用