strip url prefix from token
This commit is contained in:
parent
74dd5d0170
commit
b539f2b030
|
@ -16,7 +16,12 @@ class KagiSummarizerExtension extends Minz_Extension {
|
|||
$this->registerTranslates();
|
||||
|
||||
if (Minz_Request::isPost()) {
|
||||
FreshRSS_Context::$user_conf->kagi_token = Minz_Request::param('kagi_token', '');
|
||||
$kagi_token = Minz_Request::param('kagi_token', '');
|
||||
$prefix = 'https://kagi.com/search?token=';
|
||||
if (substr($kagi_token, 0, strlen($prefix)) == $prefix) {
|
||||
$kagi_token = substr($kagi_token, strlen($prefix));
|
||||
}
|
||||
FreshRSS_Context::$user_conf->kagi_token = $kagi_token;
|
||||
FreshRSS_Context::$user_conf->save();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue