mirror of
https://github.com/Universal-Omega/PortableInfobox.git
synced 2024-11-15 20:09:44 +00:00
DAT-4041 empty portable infobox will be supported
This commit is contained in:
parent
7976e3be75
commit
c15314dd7b
|
@ -51,9 +51,9 @@ class PortableInfoboxTemplatesHelper {
|
|||
* @param $title
|
||||
* @return array of strings (infobox markups)
|
||||
*/
|
||||
public function getMarkup($title) {
|
||||
$content = $this->fetchContent($title);
|
||||
return $this->getInfoboxes($content);
|
||||
public function getMarkup( $title ) {
|
||||
$content = $this->fetchContent( $title );
|
||||
return $this->getInfoboxes( $content );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -114,8 +114,9 @@ class PortableInfoboxTemplatesHelper {
|
|||
* @return array of striped infoboxes ready to parse
|
||||
*/
|
||||
protected function getInfoboxes( $text ) {
|
||||
preg_match_all( "/<infobox.*\\/>/sU", $text, $empty );
|
||||
preg_match_all( "/<infobox.+<\/infobox>/sU", $text, $result );
|
||||
|
||||
return $result[ 0 ];
|
||||
return array_merge( $empty[ 0 ], $result[ 0 ] );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue