Skip to content

Commit

Permalink
Merge pull request #21334 from rob006/patch-1
Browse files Browse the repository at this point in the history
Add missing encoding for `twitter:data` meta tags
  • Loading branch information
enricobattocchi committed Apr 26, 2024
2 parents f21b1b6 + 3b38247 commit 6ec25c2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/presenters/slack/enhanced-data-presenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public function present() {
$i = 1;
$class = \is_admin_bar_showing() ? ' class="yoast-seo-meta-tag"' : '';
foreach ( $enhanced_data as $label => $value ) {
$twitter_tags .= \sprintf( "\t" . '<meta name="twitter:label%1$d" content="%2$s"' . $class . ' />' . "\n", $i, $label );
$twitter_tags .= \sprintf( "\t" . '<meta name="twitter:data%1$d" content="%2$s"' . $class . ' />' . "\n", $i, $value );
$twitter_tags .= \sprintf( "\t" . '<meta name="twitter:label%1$d" content="%2$s"' . $class . ' />' . "\n", $i, \esc_attr( $label ) );
$twitter_tags .= \sprintf( "\t" . '<meta name="twitter:data%1$d" content="%2$s"' . $class . ' />' . "\n", $i, \esc_attr( $value ) );
++$i;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ protected function set_up() {
parent::set_up();

$this->stubTranslationFunctions();
$this->stubEscapeFunctions();

$this->instance = new Enhanced_Data_Presenter();
$this->instance->presentation = Mockery::mock( Indexable_Presentation::class );
Expand Down

0 comments on commit 6ec25c2

Please sign in to comment.