Skip to content

Commit

Permalink
archiveprefix - trim extracted value
Browse files Browse the repository at this point in the history
Should fix
```
[2021-10-18 17:44:38] cluebot3.INFO: doarchive(Talk:Tao, Talk:Tao/Archive, %%i, 2160, 2, 5, {{Automatic archive navigator}},{{User:ClueBot III/ArchiveNow}},2,0,0,0,, 75000, 4,) [] []
[2021-10-18 17:44:39] cluebot3.ERROR: listprefix API Error: array (   'code' => 'badvalue',   'info' => 'Unrecognized value for parameter "apnamespace": .',   '*' => 'See https://en.wikipedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> for notice of API deprecations and breaking changes.', ) [] []
```

Which is being extracted as
```
array(2) {
  [0]=>
  string(5) " Talk"
  [1]=>
  string(11) "Tao/Archive"
}

```

And thus returns a blank string for the namespace.
  • Loading branch information
DamianZaremba committed Oct 18, 2021
1 parent 4145a75 commit 504b23c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bot.php
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ function parsetemplate($page)
// {{User:ClueBot III/ArchiveThis|archiveprefix=Talk:Parkinson's law/Archives/}}
// Ensure we decode the HTML entries back to normal characters,
// otherwise when we url encode this it becomes a complete mess
$set['archiveprefix'] = html_entity_decode($set['archiveprefix'], ENT_QUOTES);
$set['archiveprefix'] = ltrim(html_entity_decode($set['archiveprefix'], ENT_QUOTES));

$logger->addInfo('doarchive(' . $page . ','
. $set['archiveprefix'] . ','
Expand Down

0 comments on commit 504b23c

Please sign in to comment.