[BakaUpdatesMangaReleasesBridge] Sanitize hash for more solid UIDs (#1113)
This should minimize occasional hiccups on regular updates.
This commit is contained in:
parent
21d3bf3b60
commit
33c16f8be5
1 changed files with 6 additions and 2 deletions
|
@ -68,7 +68,7 @@ class BakaUpdatesMangaReleasesBridge extends BridgeAbstract {
|
||||||
|
|
||||||
$item['title'] = implode(' ', $title);
|
$item['title'] = implode(' ', $title);
|
||||||
$item['uri'] = $this->getURI();
|
$item['uri'] = $this->getURI();
|
||||||
$item['uid'] = hash('sha1', $item['title']);
|
$item['uid'] = $this->getSanitizedHash($item['title']);
|
||||||
|
|
||||||
$this->items[] = $item;
|
$this->items[] = $item;
|
||||||
}
|
}
|
||||||
|
@ -89,8 +89,12 @@ class BakaUpdatesMangaReleasesBridge extends BridgeAbstract {
|
||||||
return parent::getName();
|
return parent::getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function getSanitizedHash($string) {
|
||||||
|
return hash('sha1', preg_replace('/[^a-zA-Z0-9\-\.]/', '', ucwords(strtolower($string))));
|
||||||
|
}
|
||||||
|
|
||||||
private function filterText($text) {
|
private function filterText($text) {
|
||||||
return rtrim($text, '*');
|
return rtrim($text, '* ');
|
||||||
}
|
}
|
||||||
|
|
||||||
private function filterHTML($text) {
|
private function filterHTML($text) {
|
||||||
|
|
Loading…
Reference in a new issue