Skip to content

Commit 06a0331

Browse files
committed
fixed wired.com #160
1 parent a6c6fb5 commit 06a0331

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

src/Providers/OpenGraph.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,11 @@ public function getCode()
129129
*/
130130
public function getUrl()
131131
{
132-
return $this->bag->get('url');
132+
$url = $this->bag->get('url');
133+
134+
if ($url !== $this->request->getAbsolute('/')) {
135+
return $url;
136+
}
133137
}
134138

135139
/**

tests/WiredTest.php

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
class WiredTest extends TestCaseBase
4+
{
5+
public function testOne()
6+
{
7+
$this->assertEmbed(
8+
'http://www.wired.com/?p=2064839',
9+
[
10+
'title' => 'Review: Yi 4K Action Camera',
11+
'description' => "For nearly two years GoPro’s Hero4 Black has been the standard-bearer for action cameras. But there's a new contender.",
12+
'imageWidth' => 2680,
13+
'imageHeight' => 1507,
14+
'type' => 'rich',
15+
'code' => true,
16+
]
17+
);
18+
}
19+
}

0 commit comments

Comments
 (0)