Forum
    • Categories
    • Register
    • Login

    user password containing "

    Scheduled Pinned Locked Moved Scripting
    5 Posts 4 Posters 32 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ustkU
      ustk
      last edited by

      I have a situation where a user has a " in his password.
      While wordpress is allowing it, Hise doesn't, and adds the escape char \ so the password sent during the authentication is altered...

      Is there a way to prevent this in Hise or should I just prevent from using " on the password creation page?
      Any recommended WP plugin for this?

      Hise made me an F5 dude, any other app just suffers...

      dannytaurusD David HealeyD Oli UllmannO 3 Replies Last reply Reply Quote 1
      • dannytaurusD
        dannytaurus @ustk
        last edited by

        @ustk said in user password containing ":

        prevent from using " on the password creation page

        +1 for this. Quotes get mangled all over the place. Best to avoid them.

        Meat Beats: https://meatbeats.com
        Klippr Video: https://klippr.video

        ustkU 1 Reply Last reply Reply Quote 1
        • ustkU
          ustk @dannytaurus
          last edited by

          @dannytaurus strange it's not forbidden by default...

          Hise made me an F5 dude, any other app just suffers...

          1 Reply Last reply Reply Quote 1
          • David HealeyD
            David Healey @ustk
            last edited by

            @ustk Yes I ran into this issue too a few years ago. I think it's the JWT plugin that was the issue, can't remember now.

            I added this snippet to my site to prevent users using quotations marks in their passwords.

            function prevent_quotation_mark_passwords($errors, $user) {
                if (strpos($user->user_pass, '"') !== false || strpos($user->user_pass, "'") !== false) {
                    $errors->add('password_error', __('The password cannot contain quotation marks.', 'your-text-domain'));
                }
            
                return $errors;
            }
            
            add_filter('registration_errors', 'prevent_quotation_mark_passwords', 10, 2);
            add_filter('user_profile_update_errors', 'prevent_quotation_mark_passwords', 10, 2);
            add_filter('woocommerce_registration_errors', 'prevent_quotation_mark_passwords', 11, 3);
            add_filter('woocommerce_save_account_details_errors', 'prevent_quotation_mark_passwords', 10, 3);
            
            function custom_password_reset_validation($errors, $user) {
                $new_password = isset($_POST['password_1']) ? wc_clean($_POST['password_1']) : '';
            
                // Check if the password contains quotation marks
                if (strpos($new_password, '"') !== false || strpos($new_password, "'") !== false) {
                    $errors->add('password_reset_error', __('The password cannot contain quotation marks.', 'your-text-domain'));
                }
            
                return $errors;
            }
            
            add_action('validate_password_reset', 'custom_password_reset_validation', 10, 2);
            

            Free HISE Bootcamp Full Course for beginners.
            YouTube Channel - Public HISE tutorials
            My Patreon - HISE tutorials

            1 Reply Last reply Reply Quote 2
            • Oli UllmannO
              Oli Ullmann @ustk
              last edited by

              @ustk
              Oh, good to know!

              1 Reply Last reply Reply Quote 0
              • First post
                Last post

              15

              Online

              2.1k

              Users

              13.2k

              Topics

              114.7k

              Posts