diff --git a/diaspora/diaspora.php b/diaspora/diaspora.php index 9675d7a6..64388bbd 100755 --- a/diaspora/diaspora.php +++ b/diaspora/diaspora.php @@ -10,6 +10,7 @@ require_once("addon/diaspora/Diaspora_Connection.php"); use Friendica\Core\PConfig; +use Friendica\Database\DBM; function diaspora_install() { register_hook('post_local', 'addon/diaspora/diaspora.php', 'diaspora_post_local'); @@ -136,7 +137,7 @@ function diaspora_settings(&$a,&$s) { $status = ""; $r = q("SELECT `addr` FROM `contact` WHERE `self` AND `uid` = %d", intval(local_user())); - if (dbm::is_result($r)) { + if (DBM::is_result($r)) { $status = sprintf(t("Please remember: You can always be reached from Diaspora with your Friendica handle %s. "), $r[0]['addr']); $status .= t('This connector is only meant if you still want to use your old Diaspora account for some time. '); $status .= sprintf(t('However, it is preferred that you tell your Diaspora contacts the new handle %s instead.'), $r[0]['addr']); diff --git a/mailstream/mailstream.php b/mailstream/mailstream.php index 8ff5f69f..e7721e9a 100644 --- a/mailstream/mailstream.php +++ b/mailstream/mailstream.php @@ -8,6 +8,7 @@ use Friendica\Core\Config; use Friendica\Core\PConfig; +use Friendica\Database\DBM; function mailstream_install() { register_hook('plugin_settings', 'addon/mailstream/mailstream.php', 'mailstream_plugin_settings'); @@ -167,7 +168,7 @@ function mailstream_do_images($a, &$item, &$attachments) { function mailstream_sender($item) { $r = q('SELECT * FROM `contact` WHERE `id` = %d', $item['contact-id']); - if (dbm::is_result($r)) { + if (DBM::is_result($r)) { $contact = $r[0]; if ($contact['name'] != $item['author-name']) { return $contact['name'] . ' - ' . $item['author-name']; @@ -208,7 +209,7 @@ function mailstream_subject($item) { // Don't look more than 100 levels deep for a subject, in case of loops for ($i = 0; ($i < 100) && $parent; $i++) { $r = q("SELECT `thr-parent`, `title` FROM `item` WHERE `uri` = '%s'", dbesc($parent)); - if (!dbm::is_result($r)) { + if (!DBM::is_result($r)) { break; } if ($r[0]['thr-parent'] === $parent) { diff --git a/nsfw/README b/nsfw/README index e42c2128..624fb703 100755 --- a/nsfw/README +++ b/nsfw/README @@ -47,7 +47,25 @@ done with a single regex, which matches all of them: Another use case could be, that you are simply not interested in postings about christmas. - /christmas([-_ ]?(tree|time|eve|pudding))?/ + /christmas(?:[-_ ]?(?:tree|time|eve|pudding))?/ + + +ATTENTION: + +It is absolutely important, that you use grouping +parentheses instead of capturing parentheses!! + +Grouping parentheses are: + + (?: ) + +If you use capturing parentheses, which are + + ( ) + +it will produce errors and the regex won't work and +at least your targets will not get collapsed. + 3) diff --git a/twitter/twitter.php b/twitter/twitter.php index 2fff1b18..31d3f4db 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -181,17 +181,17 @@ function twitter_settings_post ($a,$post) { * if the twitter-disconnect checkbox is set, clear the OAuth key/secret pair * from the user configuration */ - del_pconfig(local_user(), 'twitter', 'consumerkey'); - del_pconfig(local_user(), 'twitter', 'consumersecret'); - del_pconfig(local_user(), 'twitter', 'oauthtoken'); - del_pconfig(local_user(), 'twitter', 'oauthsecret'); - del_pconfig(local_user(), 'twitter', 'post'); - del_pconfig(local_user(), 'twitter', 'post_by_default'); - del_pconfig(local_user(), 'twitter', 'lastid'); - del_pconfig(local_user(), 'twitter', 'mirror_posts'); - del_pconfig(local_user(), 'twitter', 'import'); - del_pconfig(local_user(), 'twitter', 'create_user'); - del_pconfig(local_user(), 'twitter', 'own_id'); + PConfig::delete(local_user(), 'twitter', 'consumerkey'); + PConfig::delete(local_user(), 'twitter', 'consumersecret'); + PConfig::delete(local_user(), 'twitter', 'oauthtoken'); + PConfig::delete(local_user(), 'twitter', 'oauthsecret'); + PConfig::delete(local_user(), 'twitter', 'post'); + PConfig::delete(local_user(), 'twitter', 'post_by_default'); + PConfig::delete(local_user(), 'twitter', 'lastid'); + PConfig::delete(local_user(), 'twitter', 'mirror_posts'); + PConfig::delete(local_user(), 'twitter', 'import'); + PConfig::delete(local_user(), 'twitter', 'create_user'); + PConfig::delete(local_user(), 'twitter', 'own_id'); } else { if (isset($_POST['twitter-pin'])) { // if the user supplied us with a PIN from Twitter, let the magic of OAuth happen @@ -220,7 +220,7 @@ function twitter_settings_post ($a,$post) { PConfig::set(local_user(), 'twitter', 'create_user', intval($_POST['twitter-create_user'])); if (!intval($_POST['twitter-mirror'])) - del_pconfig(local_user(),'twitter','lastid'); + PConfig::delete(local_user(),'twitter','lastid'); info(t('Twitter settings updated.') . EOL); }} @@ -1850,7 +1850,7 @@ function twitter_fetch_own_contact($a, $uid) { if(count($r)) $contact_id = $r[0]["id"]; else - del_pconfig($uid, 'twitter', 'own_id'); + PConfig::delete($uid, 'twitter', 'own_id'); }