tagの各要素をtrim()する

This commit is contained in:
eai04191 2019-11-04 14:24:09 +09:00
parent 16ed4482f4
commit dc0eb0a548

View File

@ -37,7 +37,13 @@ class XtubeResolver implements Resolver
$metadata->description = trim($crawler->filter('.fullDescription ')->text('')); $metadata->description = trim($crawler->filter('.fullDescription ')->text(''));
$metadata->image = str_replace('m=eSuQ8f', 'm=eaAaaEFb', $metadata->image); $metadata->image = str_replace('m=eSuQ8f', 'm=eaAaaEFb', $metadata->image);
$metadata->image = str_replace('240X180', 'original', $metadata->image); $metadata->image = str_replace('240X180', 'original', $metadata->image);
$metadata->tags = $crawler->filter('.tagsCategories a')->extract('_text'); $metadata->tags =
array_map(
function ($text) {
return trim($text);
},
$crawler->filter('.tagsCategories a')->extract('_text')
);
return $metadata; return $metadata;
} }