See: http://stackoverflow.com/questions/
22350105/whats-the-difference-between-meta-name-and-meta-property
And https://developers.facebook.com/docs/sharing/webmasters#markup
Bug: T51859
Change-Id: Ie8fd697e8588435a69f02e779038ae5a11d67be6
}
foreach ( $this->mMetatags as $tag ) {
}
foreach ( $this->mMetatags as $tag ) {
- if ( 0 == strcasecmp( 'http:', substr( $tag[0], 0, 5 ) ) ) {
+ if ( strncasecmp( $tag[0], 'http:', 5 ) === 0 ) {
$a = 'http-equiv';
$tag[0] = substr( $tag[0], 5 );
$a = 'http-equiv';
$tag[0] = substr( $tag[0], 5 );
+ } elseif ( strncasecmp( $tag[0], 'og:', 3 ) === 0 ) {
+ $a = 'property';
$outputPage->addMeta( 'http:expires', '0' );
$outputPage->addMeta( 'keywords', 'first' );
$outputPage->addMeta( 'keywords', 'second' );
$outputPage->addMeta( 'http:expires', '0' );
$outputPage->addMeta( 'keywords', 'first' );
$outputPage->addMeta( 'keywords', 'second' );
+ $outputPage->addMeta( 'og:title', 'Ta-duh' );
$expected = [
[ 'http:expires', '0' ],
[ 'keywords', 'first' ],
[ 'keywords', 'second' ],
$expected = [
[ 'http:expires', '0' ],
[ 'keywords', 'first' ],
[ 'keywords', 'second' ],
+ [ 'og:title', 'Ta-duh' ],
];
$this->assertSame( $expected, $outputPage->getMetaTags() );
];
$this->assertSame( $expected, $outputPage->getMetaTags() );
$this->assertContains( '<meta http-equiv="expires" content="0"/>', $links );
$this->assertContains( '<meta name="keywords" content="first"/>', $links );
$this->assertContains( '<meta name="keywords" content="second"/>', $links );
$this->assertContains( '<meta http-equiv="expires" content="0"/>', $links );
$this->assertContains( '<meta name="keywords" content="first"/>', $links );
$this->assertContains( '<meta name="keywords" content="second"/>', $links );
+ $this->assertContains( '<meta property="og:title" content="Ta-duh"/>', $links );
$this->assertArrayNotHasKey( 'meta-robots', $links );
}
$this->assertArrayNotHasKey( 'meta-robots', $links );
}