diff --git a/modules/ppcp-webhooks/src/Handler/PrefixTrait.php b/modules/ppcp-webhooks/src/Handler/PrefixTrait.php index db65f224b..bc92d9e36 100644 --- a/modules/ppcp-webhooks/src/Handler/PrefixTrait.php +++ b/modules/ppcp-webhooks/src/Handler/PrefixTrait.php @@ -31,7 +31,10 @@ trait PrefixTrait { */ private function sanitize_custom_id( string $custom_id ): int { - $id = str_replace( $this->prefix, '', $custom_id ); + $id = $custom_id; + if ( strlen( $this->prefix ) > 0 && 0 === strpos( $id, $this->prefix ) ) { + $id = substr( $id, strlen( $this->prefix ) ); + } return (int) $id; } }