Improve specific tag redirect.
Previous version had a bug when the URL contained percent-encoded spaces because url.replace() was looking for spaces and not replacing the %20. Constructing the url from parts is more reliable.
This commit is contained in:
		
							parent
							
								
									29774f2524
								
							
						
					
					
						commit
						bef91b959b
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		|  | @ -80,7 +80,7 @@ def get_tags_html(specific_tag_name=None): | ||||||
|     else: |     else: | ||||||
|         specific_tag = common.P_tag(specific_tag_name, response_type='html') |         specific_tag = common.P_tag(specific_tag_name, response_type='html') | ||||||
|         if specific_tag.name != specific_tag_name: |         if specific_tag.name != specific_tag_name: | ||||||
|             new_url = request.url.replace('/tag/' + specific_tag_name, '/tag/' + specific_tag.name) |             new_url = '/tag/' + specific_tag.name + request.query_string.decode('utf-8') | ||||||
|             return flask.redirect(new_url) |             return flask.redirect(new_url) | ||||||
| 
 | 
 | ||||||
|     include_synonyms = request.args.get('include_synonyms') |     include_synonyms = request.args.get('include_synonyms') | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue