Merge pull request #816 from nupplaphil/issue/6338-fix_notices

Avoid Notices
This commit is contained in:
Tobias Diekershoff 2019-02-26 16:24:16 +01:00 committed by GitHub
commit 59ce28e3ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 11 deletions

View file

@ -46,7 +46,11 @@ class Diaspora_Connection {
public function setDiasporaID($id) { public function setDiasporaID($id) {
$parts = explode('@', $id); $parts = explode('@', $id);
$this->user = $parts[0]; $this->user = $parts[0];
if (count($parts) > 1) {
$this->host = $parts[1]; $this->host = $parts[1];
} else {
$this->host = '';
}
} }
public function getDiasporaID() { public function getDiasporaID() {

View file

@ -6,6 +6,7 @@
* Author: tony baldwin <https://free-haven.org/profile/tony> * Author: tony baldwin <https://free-haven.org/profile/tony>
* Author: Tobias Diekershoff <https://f.diekershoff.de/u/tobias> * Author: Tobias Diekershoff <https://f.diekershoff.de/u/tobias>
*/ */
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
@ -51,13 +52,17 @@ function irc_addon_settings(&$a,&$s) {
} }
function irc_addon_settings_post(&$a,&$b) { function irc_addon_settings_post(&$a, &$b) {
if(! local_user()) if(!local_user())
return; return;
if($_POST['irc-submit']) { if(!empty($_POST['irc-submit'])) {
PConfig::set( local_user(), 'irc','autochans',trim($_POST['autochans'])); if (isset($_POST['autochans'])) {
PConfig::set( local_user(), 'irc','sitechats',trim($_POST['sitechats'])); PConfig::set(local_user(), 'irc', 'autochans', trim(($_POST['autochans'])));
}
if (isset($_POST['sitechats'])) {
PConfig::set(local_user(), 'irc', 'sitechats', trim($_POST['sitechats']));
}
/* upid pop-up thing */ /* upid pop-up thing */
info(L10n::t('IRC settings saved.') . EOL); info(L10n::t('IRC settings saved.') . EOL);
} }

View file

@ -7,7 +7,7 @@
* Hauke Altmann <https://snarl.de/profile/tugelblend> * Hauke Altmann <https://snarl.de/profile/tugelblend>
* *
*/ */
use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
@ -61,13 +61,15 @@ function pageheader_addon_settings(&$a,&$s) {
} }
function pageheader_addon_settings_post(&$a,&$b) { function pageheader_addon_settings_post(&$a, &$b) {
if(! is_site_admin()) if(!is_site_admin())
return; return;
if($_POST['pageheader-submit']) { if(!empty($_POST['pageheader-submit'])) {
Config::set('pageheader','text',trim(strip_tags($_POST['pageheader-words']))); if (isset($_POST['pageheader-words'])) {
Config::set('pageheader', 'text', trim(strip_tags($_POST['pageheader-words'])));
}
info(L10n::t('pageheader Settings saved.') . EOL); info(L10n::t('pageheader Settings saved.') . EOL);
} }
} }