chg: [inbox:createEntry] Checks for remote back connection is more flexible
Handle the case of trailing slashpull/93/head
parent
670c5abaae
commit
38caafb76e
|
@ -64,8 +64,11 @@ class InboxTable extends AppTable
|
||||||
$this->Broods = \Cake\ORM\TableRegistry::getTableLocator()->get('Broods');
|
$this->Broods = \Cake\ORM\TableRegistry::getTableLocator()->get('Broods');
|
||||||
$this->Individuals = \Cake\ORM\TableRegistry::getTableLocator()->get('Individuals');
|
$this->Individuals = \Cake\ORM\TableRegistry::getTableLocator()->get('Individuals');
|
||||||
$errors = [];
|
$errors = [];
|
||||||
|
$originUrl = trim($entryData['origin'], '/');
|
||||||
$brood = $this->Broods->find()
|
$brood = $this->Broods->find()
|
||||||
->where(['url' => $entryData['origin']])
|
->where([
|
||||||
|
'url IN' => [$originUrl, "{$originUrl}/"]
|
||||||
|
])
|
||||||
->first();
|
->first();
|
||||||
if (empty($brood)) {
|
if (empty($brood)) {
|
||||||
$errors[] = __('Unkown brood `{0}`', $entryData['data']['cerebrateURL']);
|
$errors[] = __('Unkown brood `{0}`', $entryData['data']['cerebrateURL']);
|
||||||
|
|
Loading…
Reference in New Issue