mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 00:53:21 +00:00 
			
		
		
		
	GUAC-1193: Do not use <bind> within <foreach>, as it only substitutes the last bound value for *ALL* usages of the created variable. Do not use LIKE, as we would then have to escape the search term in Java.
This commit is contained in:
		| @@ -88,19 +88,18 @@ | ||||
|         <!-- Search terms --> | ||||
|         <foreach collection="terms" item="term" | ||||
|                  open="WHERE " separator=" AND "> | ||||
|             <bind name="termPattern" value="'%' + term.term + '%'" /> | ||||
|             ( | ||||
|  | ||||
|                 guacamole_connection_history.user_id IN ( | ||||
|                     SELECT user_id | ||||
|                     FROM guacamole_user | ||||
|                     WHERE username LIKE #{termPattern,jdbcType=VARCHAR} | ||||
|                     WHERE POSITION(#{term.term,jdbcType=VARCHAR} IN username) > 0 | ||||
|                 ) | ||||
|  | ||||
|                 OR guacamole_connection_history.connection_id IN ( | ||||
|                     SELECT connection_id | ||||
|                     FROM guacamole_connection | ||||
|                     WHERE connection_name LIKE #{termPattern,jdbcType=VARCHAR} | ||||
|                     WHERE POSITION(#{term.term,jdbcType=VARCHAR} IN connection_name) > 0 | ||||
|                 ) | ||||
|  | ||||
|                 <if test="term.startDate != null and term.endDate != null"> | ||||
| @@ -164,19 +163,18 @@ | ||||
|         <!-- Search terms --> | ||||
|         <foreach collection="terms" item="term" | ||||
|                  open="WHERE " separator=" AND "> | ||||
|             <bind name="termPattern" value="'%' + term.term + '%'" /> | ||||
|             ( | ||||
|  | ||||
|                 guacamole_connection_history.user_id IN ( | ||||
|                     SELECT user_id | ||||
|                     FROM guacamole_user | ||||
|                     WHERE username LIKE #{termPattern,jdbcType=VARCHAR} | ||||
|                     WHERE POSITION(#{term.term,jdbcType=VARCHAR} IN username) > 0 | ||||
|                 ) | ||||
|  | ||||
|                 OR guacamole_connection_history.connection_id IN ( | ||||
|                     SELECT connection_id | ||||
|                     FROM guacamole_connection | ||||
|                     WHERE connection_name LIKE #{termPattern,jdbcType=VARCHAR} | ||||
|                     WHERE POSITION(#{term.term,jdbcType=VARCHAR} IN connection_name) > 0 | ||||
|                 ) | ||||
|  | ||||
|                 <if test="term.startDate != null and term.endDate != null"> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user