• Resolved deejay212005

    (@deejay212005)


    I have an LMS that uses integers as meta_keys.
    This throws a critical error when wp-security-audit-log attempts string functions.

    I would like to suggest the following changes for a future update to resolve this:

    wp-security-audit-log/classes/WPSensors/class-wp-metadata-sensor.php:597
    if ( ‘_’ === substr( (string)$meta_key, 0, 1 ) ) {

    wp-security-audit-log/classes/WPSensors/class-wp-metadata-sensor.php:568
    if ( false !== strpos( (string)$meta_key, ‘shipping_’ ) || false !== strpos( (string)$meta_key, ‘billing_’ ) ) {

    wp-activity-log-for-woocommerce/wp-security-audit-log/sensors/class-woocommerce-public-sensor.php:123
    $address_key = str_replace( array( ‘shipping_’, ‘billing_’ ), ”, (string)$meta_key );

    wp-activity-log-for-woocommerce/wp-security-audit-log/sensors/class-woocommerce-sensor.php:5553
    $address_key = str_replace( array( ‘shipping_’, ‘billing_’ ), ”, (string)$meta_key );

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support robertabela

    (@robert681)

    Thank you using our plugin and for your feedback @deejay212005

    We’d like to better understand what the issue is so we can ensure a solid fix. To do this, can you explain to us, or point us to some documents that explains a bit better what is “LMS that uses integers as meta_keys.”?

    We have never heard of it so we’d like to learn more about it.

    Thread Starter deejay212005

    (@deejay212005)

    Hello @robert681

    The LMS (learning management system) we use is WPLMS.

    As an example a Quiz (post_id) stores a user ID (meta_key) and the user’s score (meta_value).

    this causes the following error:
    An error of type E_ERROR was caused in line 597 of the file /wp-content/plugins/wp-security-audit-log/classes/WPSensors/class-wp-metadata-sensor.php. Error message: Uncaught TypeError: substr(): Argument #1 ($string) must be of type string, int given in wp-content/plugins/wp-security-audit-log/classes/WPSensors/class-wp-metadata-sensor.php:597

    Plugin Support robertabela

    (@robert681)

    Thank you for the details. I’ve escalated this and we’ll include a fix in the next update of the plugin. We’ll let you know if we need more information.

    In the meantime, if you have any other questions, please do not hesitate to ask.

    Have a good day.

    Plugin Support robertabela

    (@robert681)

    Hello @deejay212005

    Today we have just released update 4.6.0 which includes this fix. You can read the WP Activity Log release notes for more details about what is new and improved in this update.

    Please install the latest version of the plugin to fix the issue.

    Thank you for using our plugin.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Critical Error metadata-sensor type string, int given’ is closed to new replies.