Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .whitesource
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
##########################################################
#### WhiteSource "Bolt for Github" configuration file ####
##########################################################

# Configuration #
#---------------#
ws.repo.scan=true
vulnerable.check.run.conclusion.level=success
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"php": ">=5.3.0",
"phpzip/phpzip": "~2.0.7",
"grandt/phpresizegif": "~1.0.3",
"grandt/relativepath": "~1.0.1"
"grandt/relativepath": "~1.0.1",
"masterminds/html5": "^2.1"
},
"autoload": {
"psr-4": {
Expand Down
9 changes: 5 additions & 4 deletions src/PHPePub/Core/EPub.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
namespace PHPePub\Core;

use com\grandt\BinStringStatic;
use Masterminds\HTML5;
use DOMDocument;
use DOMXPath;
use PHPePub\Core\Structure\Ncx;
Expand Down Expand Up @@ -358,8 +359,8 @@ function addChapter($chapterName, $fileName, $chapterData = null, $autoSplit = f
* @return array
*/
function findIdAttributes($chapterData) {
$xmlDoc = new DOMDocument();
@$xmlDoc->loadHTML($chapterData);
$html5 = new HTML5();
$xmlDoc = $html5->loadHTML($chapterData);

$xpath = new DomXpath($xmlDoc);

Expand Down Expand Up @@ -420,8 +421,8 @@ protected function processChapterExternalReferences(&$doc, $externalReferences =
if ($isDocAString) {
$doc = StringHelper::removeComments($doc);

$xmlDoc = new DOMDocument();
@$xmlDoc->loadHTML($doc);
$html5 = new HTML5();
$xmlDoc = $html5->loadHTML($doc);
} else {
$xmlDoc = $doc;
}
Expand Down
5 changes: 3 additions & 2 deletions src/PHPePub/Core/EPubChapterSplitter.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
namespace PHPePub\Core;

use Masterminds\HTML5;
use DOMDocument;

/**
Expand Down Expand Up @@ -77,8 +78,8 @@ function splitChapter($chapter, $splitOnSearchString = false, $searchString = '/
);
}

$xmlDoc = new DOMDocument();
@$xmlDoc->loadHTML($chapter);
$html5 = new HTML5();
$xmlDoc = $html5->loadHTML($chapter);

$head = $xmlDoc->getElementsByTagName("head");
$body = $xmlDoc->getElementsByTagName("body");
Expand Down
3 changes: 2 additions & 1 deletion tests/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"require": {
"php": ">=5.3.0",
"phpzip/phpzip": ">=2.0.7"
"phpzip/phpzip": ">=2.0.7",
"masterminds/html5": "^2.1"
},
"autoload": {
"psr-4": {
Expand Down