Skip to content

Commit

Permalink
Updated fuzzy hash sample for the Scan Helper with one of a bigger si…
Browse files Browse the repository at this point in the history
…ze. (#39750)

* Updated fuzzy hash sample for the Scan Helper with one of a bigger size.

* Exchanged fuzzy hash test file with a more reasonable placeholder content.
  • Loading branch information
ArSn authored Oct 28, 2024
1 parent 71640d2 commit 74210e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Scan Helper: Update fuzzy hash sample to be bigger in size.
10 changes: 2 additions & 8 deletions projects/plugins/debug-helper/modules/class-scan-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -581,14 +581,8 @@ private function fuzzy_hash_threat_exists() {
* @return string|WP_Error Success message on success, WP_Error object on failure.
*/
private function generate_fuzzy_hash_threat() {
$content = base64_decode(
'PEZpbGVzTWF0Y2ggIi4ocHl8ZXhlfHBocCkkIj4KIE9yZGVyIGFsbG93LGRlbnkKIERlbnkgZnJvbSBhbGwKPC9GaWxlc01hdG' .
'NoPgo8RmlsZXNNYXRjaCAiXihhYm91dC5waHB8cmFkaW8ucGhwfGluZGV4LnBocHxjb250ZW50LnBocHxsb2NrMzYwLnBocCkkIj4KIE' .
'9yZGVyIGFsbG93LGRlbnkKIEFsbG93IGZyb20gYWxsCjwvRmlsZXNNYXRjaD4KPElmTW9kdWxlIG1vZF9yZXdyaXRlLmM+ClJld3JpdG' .
'VFbmdpbmUgT24KUmV3cml0ZUJhc2UgLwpSZXdyaXRlUnVsZSBeaW5kZXhcLnBocCQgLSBbTF0KUmV3cml0ZUNvbmQgJXtSRVFVRVNUX0' .
'ZJTEVOQU1FfSAhLWYKUmV3cml0ZUNvbmQgJXtSRVFVRVNUX0ZJTEVOQU1FfSAhLWQKUmV3cml0ZVJ1bGUgLiAvaW5kZXgucGhwIFtMXQ' .
'o8L0lmTW9kdWxlPg=='
);
// We need at least 4 kilobyte, 201 * 20 = 4020 bytes
$content = str_repeat( 'JETPACK-TEST-THREAT-', 201 );

if ( ! $this->write_file( $this->threats['fuzzy_hash_file'], $content ) ) {
return new WP_Error( 'could-not-write', "Unable to write threat to {$this->threats['fuzzy_hash_file']}" );
Expand Down

0 comments on commit 74210e4

Please sign in to comment.