1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-31 15:24:31 +03:00

Applied latest styleci changes

This commit is contained in:
Dan Brown
2021-11-01 13:26:02 +00:00
parent ce3f489188
commit a17be959d8
10 changed files with 15 additions and 14 deletions

View File

@ -149,15 +149,17 @@ class PageContent
/**
* Parse a base64 image URI into the data and extension.
*
* @return array{extension: array, data: string}
*/
protected function parseBase64ImageUri(string $uri): array
{
[$dataDefinition, $base64ImageData] = explode(',', $uri, 2);
$extension = strtolower(preg_split('/[\/;]/', $dataDefinition)[1] ?? '');
return [
'extension' => $extension,
'data' => base64_decode($base64ImageData) ?: '',
'data' => base64_decode($base64ImageData) ?: '',
];
}