less code
This commit is contained in:
		
							parent
							
								
									fb111803c7
								
							
						
					
					
						commit
						79ce40abd0
					
				| @ -34,6 +34,9 @@ function int_escape($input) { | |||||||
|  * @retval string |  * @retval string | ||||||
|  */ |  */ | ||||||
| function url_escape($input) { | function url_escape($input) { | ||||||
|  | 	if(is_null($input)) { | ||||||
|  | 		return ""; | ||||||
|  | 	} | ||||||
| 	$input = str_replace('^', '^^', $input); | 	$input = str_replace('^', '^^', $input); | ||||||
| 	$input = str_replace('/', '^s', $input); | 	$input = str_replace('/', '^s', $input); | ||||||
| 	$input = str_replace('\\', '^b', $input); | 	$input = str_replace('\\', '^b', $input); | ||||||
|  | |||||||
| @ -133,12 +133,7 @@ class ViewImage extends Extension { | |||||||
| 			send_event(new ImageInfoSetEvent(Image::by_id($image_id))); | 			send_event(new ImageInfoSetEvent(Image::by_id($image_id))); | ||||||
| 
 | 
 | ||||||
| 			$page->set_mode("redirect"); | 			$page->set_mode("redirect"); | ||||||
| 			if(isset($_POST['query'])) { | 			$page->set_redirect(make_link("post/view/$image_id", url_escape(@$_POST['query']))); | ||||||
| 				$page->set_redirect(make_link("post/view/$image_id", url_escape($_POST['query']))); |  | ||||||
| 			} |  | ||||||
| 			else { |  | ||||||
| 				$page->set_redirect(make_link("post/view/$image_id")); |  | ||||||
| 			} |  | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user