File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,8 @@ public function __construct ($uri = null) {
2929 }
3030
3131
32- public function load ($ uri ) {
32+ public function load ($ uri )
33+ {
3334 if ($ this ->handle ) {
3435 $ this ->close ();
3536 }
Original file line number Diff line number Diff line change @@ -14,16 +14,27 @@ public function __construct (Url $Url) {
1414 return false ;
1515 }
1616
17+ $ images = array ();
18+
1719 foreach ($ Html ->getElementsByTagName ('meta ' ) as $ Tag ) {
1820 if ($ Tag ->hasAttribute ('property ' ) && (strpos ($ Tag ->getAttribute ('property ' ), 'og: ' ) === 0 )) {
19- $ this ->set (substr ($ Tag ->getAttribute ('property ' ), 3 ), $ Tag ->getAttribute ('content ' ) ?: $ Tag ->getAttribute ('value ' ));
21+ $ name = substr ($ Tag ->getAttribute ('property ' ), 3 );
22+ } else if ($ Tag ->hasAttribute ('name ' ) && (strpos ($ Tag ->getAttribute ('name ' ), 'og: ' ) === 0 )) {
23+ $ name = substr ($ Tag ->getAttribute ('name ' ), 3 );
24+ } else {
2025 continue ;
2126 }
2227
23- if ($ Tag ->hasAttribute ('name ' ) && (strpos ($ Tag ->getAttribute ('name ' ), 'og: ' ) === 0 )) {
24- $ this ->set (substr ($ Tag ->getAttribute ('name ' ), 3 ), $ Tag ->getAttribute ('content ' ) ?: $ Tag ->getAttribute ('value ' ));
28+ $ value = $ Tag ->getAttribute ('content ' ) ?: $ Tag ->getAttribute ('value ' );
29+
30+ if ($ name === 'image ' ) {
31+ $ images [] = $ value ;
32+ } else {
33+ $ this ->set ($ name , $ value );
2534 }
2635 }
36+
37+ $ this ->set ('image ' , $ images );
2738 }
2839
2940 public function getTitle () {
You can’t perform that action at this time.
0 commit comments