mirror of
				https://github.com/pierre42100/ComunicAndroid
				synced 2025-10-31 09:34:47 +00:00 
			
		
		
		
	Now escape BBCode
This commit is contained in:
		| @@ -148,4 +148,14 @@ public class StringsUtils { | ||||
|         return result; | ||||
|  | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Remove all BBCode tags of a given string | ||||
|      * | ||||
|      * @param string The string to update | ||||
|      * @return The same string, without any bbcode tags | ||||
|      */ | ||||
|     public static String RemoveBBCode(String string){ | ||||
|         return string.replaceAll("\\[[a-zA-Z1-9/=#]{1,10}]", ""); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -20,6 +20,7 @@ import org.communiquons.android.comunic.client.data.enums.PageType; | ||||
| import org.communiquons.android.comunic.client.data.models.Comment; | ||||
| import org.communiquons.android.comunic.client.data.models.Post; | ||||
| import org.communiquons.android.comunic.client.data.models.UserInfo; | ||||
| import org.communiquons.android.comunic.client.data.utils.StringsUtils; | ||||
| import org.communiquons.android.comunic.client.data.utils.TimeUtils; | ||||
| import org.communiquons.android.comunic.client.ui.listeners.onPostUpdateListener; | ||||
| import org.communiquons.android.comunic.client.ui.utils.UiUtils; | ||||
| @@ -315,7 +316,11 @@ public class PostsAdapter extends BaseRecyclerViewAdapter { | ||||
|  | ||||
|  | ||||
|             //Set post content | ||||
|             mPostContent.setParsedText(UiUtils.prepareStringTextView(post.getContent())); | ||||
|             mPostContent.setParsedText( | ||||
|                     StringsUtils.RemoveBBCode( | ||||
|                             UiUtils.prepareStringTextView(post.getContent()) | ||||
|                     ) | ||||
|             ); | ||||
|  | ||||
|  | ||||
|             //Post likes | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Pierre HUBERT
					Pierre HUBERT