Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: HTML would break if taxonomy name contained apostrophies. #225

Merged
merged 3 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function maybe_add_custom_params( $params ) {
// Loop through the terms.
foreach ( $terms as $term ) {
if ( $term instanceof WP_Term ) {
$params .= " event-{$taxonomy}='{$term->name}'";
$params .= " event-{$taxonomy}=\"{$term->name}\"";
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion tests/integration/Integrations/WooCommerceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@

namespace Plausible\Analytics\Tests\Integration;

use AllowDynamicProperties;
use Plausible\Analytics\Tests\TestCase;
use Plausible\Analytics\WP\Integrations\WooCommerce;
use function Brain\Monkey\Functions\when;

#[AllowDynamicProperties]
class WooCommerceTest extends TestCase {
/**
* @see WooCommerce::track_entered_checkout()
Expand Down Expand Up @@ -63,7 +65,7 @@ public function testTrackPurchase() {

when( 'wc_get_order' )->justReturn( $mock );

$this->expectOutputContains( '{"revenue":{"amount":"10.00","currency":"EUR"}}' );
$this->expectOutputContains( '{"revenue":{"amount":"10","currency":"EUR"}}' );

$class->track_purchase( 1 );
}
Expand Down