From db29dc6bff8ed465277c919303d119f52340fdfe Mon Sep 17 00:00:00 2001 From: Habeas Codice Date: Fri, 21 Nov 2014 15:33:21 -0800 Subject: implicit type conversion --- mod/profile_photo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/profile_photo.php b/mod/profile_photo.php index 24439d404..e9dad6f51 100644 --- a/mod/profile_photo.php +++ b/mod/profile_photo.php @@ -33,7 +33,7 @@ function profile_photo_set_profile_perms($profileid = '') { if (intval($profile['is_default']) != 1) { $r0 = q("SELECT channel_hash FROM channel WHERE channel_id = %d LIMIT 1", intval(local_user()) ); - $r1 = q("SELECT abook.abook_xchan FROM abook WHERE abook_profile = %d ", intval($profile['id'])); //Should not be needed in future. Catches old int-profile-ids. + $r1 = q("SELECT abook.abook_xchan FROM abook WHERE abook_profile = '%d' ", intval($profile['id'])); //Should not be needed in future. Catches old int-profile-ids. $r2 = q("SELECT abook.abook_xchan FROM abook WHERE abook_profile = '%s'", dbesc($profile['profile_guid'])); $allowcid = "<" . $r0[0]['channel_hash'] . ">"; foreach ($r1 as $entry) { -- cgit v1.2.3 From b224f8056cbf9b41994b44e48a7ad154976d1c88 Mon Sep 17 00:00:00 2001 From: Habeas Codice Date: Fri, 21 Nov 2014 15:35:59 -0800 Subject: new system config reserved_channels prevents members from creating channels in a reserved list --- doc/hidden_configs.bb | 2 ++ include/text.php | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/hidden_configs.bb b/doc/hidden_configs.bb index 7b7a688c4..da5134123 100644 --- a/doc/hidden_configs.bb +++ b/doc/hidden_configs.bb @@ -100,6 +100,8 @@ This document assumes you're an administrator. the main logs as well. [b]system > hide_in_statistics[/b] Tell the red statistics servers to completely hide this hub in hub lists. + [b]system > reserved_channels[/b] + Don't allow members to register channels with this comma separated list of names (no spaces) #include doc/macros/main_footer.bb; diff --git a/include/text.php b/include/text.php index 22a1a78c4..ce729ac1b 100644 --- a/include/text.php +++ b/include/text.php @@ -1815,8 +1815,13 @@ function legal_webbie($s) { function check_webbie($arr) { + $reservechan = get_config('system','reserved_channels'); + if(strlen($reservechan)) + $taken = explode(',', $reservechan); + else + $taken = array(); + $str = ''; - $taken = array(); if(count($arr)) { foreach($arr as $x) { $y = legal_webbie($x); -- cgit v1.2.3 From ecb86dd6b20adf2e7587e5b16f8eb7cd7b8f1b68 Mon Sep 17 00:00:00 2001 From: Habeas Codice Date: Sat, 22 Nov 2014 09:26:46 -0800 Subject: somehow missed this one was causing problems with pickup messages originating from postgres servers --- include/dba/dba_driver.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/dba/dba_driver.php b/include/dba/dba_driver.php index 1bb45b06d..a62a5e6e2 100755 --- a/include/dba/dba_driver.php +++ b/include/dba/dba_driver.php @@ -341,6 +341,8 @@ function dbesc_array_cb(&$item, $key) { if(is_string($item)) { if($item == '0000-00-00 00:00:00' && ACTIVE_DBTYPE == DBTYPE_POSTGRES) $item = '0001-01-01 00:00:00'; + else if($item == '0001-01-01 00:00:00' && ACTIVE_DBTYPE == DBTYPE_MYSQL) + $item = '0000-00-00 00:00:00'; $item = dbesc($item); } } -- cgit v1.2.3 From ab5bf1b7d69f4027f595eef56cf4d99207b8b46e Mon Sep 17 00:00:00 2001 From: Habeas Codice Date: Sat, 22 Nov 2014 11:54:40 -0800 Subject: prevent database hackery from leaking over the wire --- include/items.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/items.php b/include/items.php index 477b5197e..c488e1953 100755 --- a/include/items.php +++ b/include/items.php @@ -1094,7 +1094,8 @@ function encode_item($item,$mirror = false) { $x['message_parent'] = $item['thr_parent']; $x['created'] = $item['created']; $x['edited'] = $item['edited']; - $x['expires'] = $item['expires']; + // always send 0's over the wire + $x['expires'] = (($item['expires'] == '0001-01-01 00:00:00') ? '0000-00-00 00:00:00' : $item['expires']); $x['commented'] = $item['commented']; $x['mimetype'] = $item['mimetype']; $x['title'] = $item['title']; -- cgit v1.2.3