Skip to content

Commit

Permalink
Only mask license if needed
Browse files Browse the repository at this point in the history
Fix PHP error from occurring during license check if no license present (affects extensions).
  • Loading branch information
jakejackson1 committed Oct 25, 2024
1 parent d9f37dc commit bb5a359
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gravity-pdf-updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function( $response, $context, $class, $parsed_args, $url ) {
$logger = \GPDFAPI::get_log_class();

$request_body = $parsed_args['body'] ?? [];
if ( isset( $request_body['license'] ) ) {
if ( isset( $request_body['license'] ) && is_string( $request_body['license'] ) && strlen( $request_body['license'] ) > 2 ) {
/* mask the license key, if exists */
$license = $request_body['license'];
$request_body['license'] = substr( $license, 0, 1 ) . str_repeat( '*', strlen( $license ) - 2 ) . substr( $license, -1, 1 );
Expand Down

0 comments on commit bb5a359

Please sign in to comment.