Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-4753

Record Payment does not validate the length of the transaction ID string

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.5.1
    • Fix Version/s: 5.7.0-b1
    • Component/s: Staff Interface
    • Labels:
      None

      Description

      When recording a payment as staff for a client, the Check/ID field relates to the transactions.transaction_id column which is varchar(128) but it is possible to enter a value longer than 128 as the length is not validated.

      Instead, we should not allow a value larger than 128 to be submitted. Consider databases with a collation of utf8mb4.

      [2022-08-29T15:19:13.701421+00:00] general.ERROR: PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'transaction_id' at row 1 in /home/blestau/public_html/551/vendors/minphp/db/src/PdoConnection.php:196 Stack trace: #0 /home/blestau/public_html/551/vendors/minphp/db/src/PdoConnection.php(196): PDOStatement->execute(Array) #1 /home/blestau/public_html/551/vendors/minphp/record/src/Record.php(305): Minphp\Db\PdoConnection->query('INSERT INTO `tr...', Array) #2 /home/blestau/public_html/551/app/models/transactions.php(71): Minphp\Record\Record->insert('transactions', Array, Array) #3 /home/blestau/public_html/551/app/controllers/admin_clients.php(4392): Transactions->add(Array) #4 /home/blestau/public_html/551/vendors/minphp/bridge/src/Lib/Dispatcher.php(142): AdminClients->recordPayment() #5 /home/blestau/public_html/551/index.php(21): Dispatcher::dispatch('/551/admin/clie...') #6

      {main}

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            abdy Abdy Franco
            Reporter:
            admin Paul Phillips
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              4/May/23

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 1 hour, 5 minutes
              1h 5m

                Agile