IPB - Special Characters Problem

Discussion in 'Forum Software Development' started by GrizzlyA, Jan 31, 2016.

  1. GrizzlyA

    GrizzlyA Neophyte

    3
    1
    +0
    So for some reason passwords with special characters (!, @, $, etc) do not work.
    Any idea why IP.Board is doing this? (I also tried mysql & mysqli)

    This is the script I wrote:
    Code:
    <?php
    // Script Details
    define( 'IPB_THIS_SCRIPT', 'public' );
    
    // Include Headers
    require_once( './initdata.php' );
    require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );
    
    // Initialize Registry
    IPSRegistry::init();
    
    // Include Headers (After Registry)
    require_once( IPS_ROOT_PATH . 'sources/base/ipsMember.php' );
    
    // Check Parameters
    if (!isset($_GET['id']) || !isset($_GET['pw']))
    {
    // Display Error
    echo "MISSING_PARAMETERS";
    
    // Stop Execution
    exit;
    }
    
    // Setup Parameters
    $Parameter['UserID'] = $_GET['id'];
    $Parameter['Password'] = md5($_GET['pw']);
    
    // Authenticate User
    if ( ipsMember::authenticateMember( $Parameter['UserID'], $Parameter['Password'] ) == true )
    echo "SUCCESS_LOGIN";
    else
    echo "FAIL_LOGIN";
    
    // Stop Execution
    exit();
    ?> 
     
  2. GrizzlyA

    GrizzlyA Neophyte

    3
    1
    +0
    Anybody?
     
  3. dtdesign

    dtdesign Developer

    569
    287
    +658
    My guess is that your input data doesn't match the encoding used by IP.B. For instance, content encoded with ISO-8859-1 and UTF-8 has a different binary representation and algorithms such as md5() work with the binary data directly, as a result the hash will differ even though the content itself is identical.
     
  4. GrizzlyA

    GrizzlyA Neophyte

    3
    1
    +0
    I found the fix, for some reason IPB saves special chars in their HTML form (thus "!" becomes "&#0033;")
    It's really stupid and I coded a function that replaces input data with their HTML form, isn't there a way in IPB to do this?

    Thanks!
     
  5. dtdesign

    dtdesign Developer

    569
    287
    +658
    I'm sorry, but I have never really worked with IP.B and I was just making an educated guess :D
     
  6. Tracy Perry

    Tracy Perry Opinionated asshat

    4,988
    552
    +3,591
    I imagine it's their push to be "pure html"... and it steps in at some unexpected places.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.