From ec8091a102b9cb2f8f47ef87982533bcd5ba9886 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 22 Jun 2016 18:00:18 -0700 Subject: use the normal html escape for '@' in addresses rather than the high-plane unicode variant. This makes it copy-able, but not easily scrape-able. --- include/channel.php | 2 +- include/widgets.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/channel.php b/include/channel.php index 562aedddc..a0424ee39 100644 --- a/include/channel.php +++ b/include/channel.php @@ -862,7 +862,7 @@ function profile_load(&$a, $nickname, $profile = '') { ); if($z) { $p[0]['picdate'] = $z[0]['xchan_photo_date']; - $p[0]['reddress'] = str_replace('@','@',$z[0]['xchan_addr']); + $p[0]['reddress'] = str_replace('@','@',$z[0]['xchan_addr']); } // fetch user tags if this isn't the default profile diff --git a/include/widgets.php b/include/widgets.php index cdd5d72ab..8a7f4b69f 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -1158,7 +1158,7 @@ function widget_cover_photo($arr) { if(array_key_exists('subtitle', $arr) && isset($arr['subtitle'])) $subtitle = $arr['subtitle']; else - $subtitle = $channel['xchan_addr']; + $subtitle = str_replace('@','@',$channel['xchan_addr']); $c = get_cover_photo($channel_id,'html'); -- cgit v1.2.3 From 1267d995ef031f6ecf4d1f1951a700dfdcbf6c8d Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 22 Jun 2016 19:08:59 -0700 Subject: db statement debugging --- include/dba/dba_driver.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/dba/dba_driver.php b/include/dba/dba_driver.php index df072ed76..f6091f6e1 100755 --- a/include/dba/dba_driver.php +++ b/include/dba/dba_driver.php @@ -90,7 +90,7 @@ abstract class dba_driver { protected $db; protected $pdo = array(); - public $debug = 0; + public $debug = 0; public $connected = false; public $error = false; @@ -332,6 +332,9 @@ function q($sql) { else db_logger('dba: vsprintf error: ' . print_r(debug_backtrace(), true),LOGGER_NORMAL,LOG_CRIT); } + if(\DBA::$dba->debug) + db_logger('Sql: ' . $stmt, LOGGER_DEBUG, LOG_INFO); + return \DBA::$dba->q($stmt); } -- cgit v1.2.3 From cef77ce5bb296829576f5d7a515b56a8b18f99eb Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 22 Jun 2016 19:22:59 -0700 Subject: the xchan_query wasn't fully optimised as we were comparing quoted and unquoted strings when looking for duplicates --- include/text.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/text.php b/include/text.php index 4f28c6dbc..12b6b1137 100644 --- a/include/text.php +++ b/include/text.php @@ -2089,9 +2089,9 @@ function xchan_query(&$items,$abook = true,$effective_uid = 0) { } foreach($items as $item) { - if($item['owner_xchan'] && (! in_array($item['owner_xchan'],$arr))) + if($item['owner_xchan'] && (! in_array("'" . dbesc($item['owner_xchan']) . "'",$arr))) $arr[] = "'" . dbesc($item['owner_xchan']) . "'"; - if($item['author_xchan'] && (! in_array($item['author_xchan'],$arr))) + if($item['author_xchan'] && (! in_array("'" . dbesc($item['author_xchan']) . "'",$arr))) $arr[] = "'" . dbesc($item['author_xchan']) . "'"; } } @@ -2124,9 +2124,9 @@ function xchan_mail_query(&$item) { $arr = array(); $chans = null; if($item) { - if($item['from_xchan'] && (! in_array($item['from_xchan'],$arr))) + if($item['from_xchan'] && (! in_array("'" . dbesc($item['from_xchan']) . "'",$arr))) $arr[] = "'" . dbesc($item['from_xchan']) . "'"; - if($item['to_xchan'] && (! in_array($item['to_xchan'],$arr))) + if($item['to_xchan'] && (! in_array("'" . dbesc($item['to_xchan']) . "'",$arr))) $arr[] = "'" . dbesc($item['to_xchan']) . "'"; } -- cgit v1.2.3