jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/333891 )
Change subject: Allow OpenGraph RFDa meta tags ...................................................................... Allow OpenGraph RFDa meta tags 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 --- M includes/OutputPage.php M tests/phpunit/includes/OutputPageTest.php 2 files changed, 6 insertions(+), 1 deletion(-) Approvals: Daniel Kinzler: Looks good to me, but someone else must approve Florianschmidtwelzow: Looks good to me, approved jenkins-bot: Verified Thiemo Mättig (WMDE): Looks good to me, but someone else must approve Jdlrobson: Looks good to me, but someone else must approve diff --git a/includes/OutputPage.php b/includes/OutputPage.php index fd28f4a..91fc75c 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -3259,9 +3259,11 @@ } 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 ); + } elseif ( strncasecmp( $tag[0], 'og:', 3 ) === 0 ) { + $a = 'property'; } else { $a = 'name'; } diff --git a/tests/phpunit/includes/OutputPageTest.php b/tests/phpunit/includes/OutputPageTest.php index 371731b..d2494da 100644 --- a/tests/phpunit/includes/OutputPageTest.php +++ b/tests/phpunit/includes/OutputPageTest.php @@ -22,11 +22,13 @@ $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' ], + [ 'og:title', 'Ta-duh' ], ]; $this->assertSame( $expected, $outputPage->getMetaTags() ); @@ -34,6 +36,7 @@ $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 ); } -- To view, visit https://gerrit.wikimedia.org/r/333891 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie8fd697e8588435a69f02e779038ae5a11d67be6 Gerrit-PatchSet: 7 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Ladsgroup <ladsgr...@gmail.com> Gerrit-Reviewer: Addshore <addshorew...@gmail.com> Gerrit-Reviewer: Aude <aude.w...@gmail.com> Gerrit-Reviewer: Daniel Kinzler <daniel.kinz...@wikimedia.de> Gerrit-Reviewer: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com> Gerrit-Reviewer: Jdlrobson <jrob...@wikimedia.org> Gerrit-Reviewer: Ladsgroup <ladsgr...@gmail.com> Gerrit-Reviewer: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits