• Resolved dgtalgoodies

    (@dgtalgoodies)


    Hi there, if anyone could help me with the issues am facing it would be greatly appreciated. These issues are regarding security or abuse concerns.

    1. When uploading a profile picture UserWP plugin allows all file types, is there anything I can do to change this?

    2. When registering and editing a profile you can add unlimited characters and even some special characters into the input boxes, is there anything I can do to change this?

    Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi,

    1. We have provided a filter ‘uwp_fields_allowed_mime_types’ which allows changing the allowed MIME types.

    2. You might restrict using custom JS or customisation in the plugin.

    Regards,
    Patrik

    Thread Starter dgtalgoodies

    (@dgtalgoodies)

    Hi,

    Thank you for the reply but i will need a bit more information ??

    1. Can you provide some kind of documents or tutorial on this subject? I am not a programmer and never heard of mime before. I basically want to allow only jpeg and png to be uploaded.

    2. When you say in the plugin where are you referring to?

    Thank you.

    Hi,

    You can try adding following code in functions.php file of currently active theme or via Code Snippets plugin and let me know if it helps or not:

    add_filter('uwp_fields_allowed_mime_types', 'uwp_fields_allowed_mime_types_cb', 10, 2);
    function uwp_fields_allowed_mime_types_cb($allowed_mime_types, $htmlvar_name){
    	if(in_array($htmlvar_name, array('avatar', 'banner'))) {
    		$allowed_mime_types = array(
    			'jpg',
    			'jpe',
    			'jpeg',
    			'png'
    		);
    
    		return $allowed_mime_types;
    	}
    }

    Just change the extensions as per your requirements.

    Regards,
    Patrik

    Thread Starter dgtalgoodies

    (@dgtalgoodies)

    Hi Patrick and thank you for reaching out and offering your support I appreciate it ??
    I have added the snippet at the bottom of my theme function.php and it caused a critical error stopping the site from loading so I removed it and then I tried in wp-inlcude folder but it changed nothing, I post a link that will show you a screenshot.

    https://prnt.sc/26sevqk

    Thank you.

    Thread Starter dgtalgoodies

    (@dgtalgoodies)

    I understand, Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Maximum Character & Special Character and file type’ is closed to new replies.