Skip to content

Commit 6083f83

Browse files
committed
Prevent strict notices from calling DOMDocument::loadHtml() statically. See #55
1 parent dc411b5 commit 6083f83

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

includes/class-gistpress.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,8 @@ public function process_gist_html( $html, array $args ) {
469469
return $html;
470470
}
471471

472-
$dom = DOMDocument::loadHTML( $html );
472+
$dom = new DOMDocument();
473+
$dom->loadHTML( $html );
473474

474475
// @todo Make this more unique?
475476
$lines = $dom->getElementsByTagName( 'tr' );
@@ -554,7 +555,8 @@ public function process_gist_html( $html, array $args ) {
554555
public function process_gist_line_numbers( $html, array $range, $start = null ) {
555556
$start = empty( $start ) ? absint( $range['min'] ) : absint( $start );
556557

557-
$dom = DOMDocument::loadHTML( $html );
558+
$dom = new DOMDocument();
559+
$dom->loadHTML( $html );
558560
$lines = $dom->getElementsByTagName( 'tr' );
559561

560562
foreach ( $lines as $i => $line ) {

0 commit comments

Comments
 (0)