Merge branch 'master' of github.com:BookStackApp/BookStack

This commit is contained in:
Dan Brown 2018-03-30 14:10:36 +01:00
commit 58a6b2df7d
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
3 changed files with 5 additions and 3 deletions

View File

@ -201,5 +201,4 @@ class Entity extends Ownable
{ {
return '/'; return '/';
} }
} }

View File

@ -784,7 +784,9 @@ class EntityRepo
$scriptSearchRegex = '/<script.*?>.*?<\/script>/ms'; $scriptSearchRegex = '/<script.*?>.*?<\/script>/ms';
$matches = []; $matches = [];
preg_match_all($scriptSearchRegex, $html, $matches); preg_match_all($scriptSearchRegex, $html, $matches);
if (count($matches) === 0) return $html; if (count($matches) === 0) {
return $html;
}
foreach ($matches[0] as $match) { foreach ($matches[0] as $match) {
$html = str_replace($match, htmlentities($match), $html); $html = str_replace($match, htmlentities($match), $html);

View File

@ -192,7 +192,8 @@ class ImageService extends UploadService
* @param Image $image * @param Image $image
* @return boolean * @return boolean
*/ */
protected function isGif(Image $image) { protected function isGif(Image $image)
{
return strtolower(pathinfo($this->getPath($image), PATHINFO_EXTENSION)) === 'gif'; return strtolower(pathinfo($this->getPath($image), PATHINFO_EXTENSION)) === 'gif';
} }