From 303324cdff3f7c8bc83fae89256a2133939944b2 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 12 Dec 2013 02:15:02 -0800 Subject: more htmlspecialchars sanitisation --- include/network.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/network.php') diff --git a/include/network.php b/include/network.php index 50f853ca0..225b215fe 100644 --- a/include/network.php +++ b/include/network.php @@ -582,7 +582,7 @@ function scale_external_images($s, $include_link = true, $scale_replace = false) $a = get_app(); // Picture addresses can contain special characters - $s = htmlspecialchars_decode($s); + $s = htmlspecialchars_decode($s, ENT_COMPAT,'UTF-8'); $matches = null; $c = preg_match_all('/\[img(.*?)\](.*?)\[\/img\]/ism',$s,$matches,PREG_SET_ORDER); -- cgit v1.2.3 From 3a11980e495fc42c9fbf178480d16380f6cca69a Mon Sep 17 00:00:00 2001 From: zottel Date: Thu, 12 Dec 2013 13:32:11 +0100 Subject: htmspecialchars_decode only takes one argument. --- include/network.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/network.php') diff --git a/include/network.php b/include/network.php index 225b215fe..7446c2384 100644 --- a/include/network.php +++ b/include/network.php @@ -582,7 +582,7 @@ function scale_external_images($s, $include_link = true, $scale_replace = false) $a = get_app(); // Picture addresses can contain special characters - $s = htmlspecialchars_decode($s, ENT_COMPAT,'UTF-8'); + $s = htmlspecialchars_decode($s, ENT_COMPAT); $matches = null; $c = preg_match_all('/\[img(.*?)\](.*?)\[\/img\]/ism',$s,$matches,PREG_SET_ORDER); -- cgit v1.2.3 From 7c81889b3397f09dfba4f17bba99f6d1dad9d0b2 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 19 Dec 2013 16:33:36 -0800 Subject: make default profile photo configurable - should be functional but needs admin ui --- include/network.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/network.php') diff --git a/include/network.php b/include/network.php index 7446c2384..3fe7f5400 100644 --- a/include/network.php +++ b/include/network.php @@ -548,7 +548,7 @@ function avatar_img($email) { call_hooks('avatar_lookup', $avatar); if(! $avatar['success']) - $avatar['url'] = $a->get_baseurl() . '/images/default_profile_photos/rainbow_man/175.jpg'; + $avatar['url'] = $a->get_baseurl() . '/' . get_default_profile_photo(); logger('Avatar: ' . $avatar['email'] . ' ' . $avatar['url'], LOGGER_DEBUG); return $avatar['url']; -- cgit v1.2.3 From 0a2b2a139080b41c10bbc7fc0f3b24129f2c3c38 Mon Sep 17 00:00:00 2001 From: Michael Meer Date: Thu, 30 Jan 2014 10:39:09 +0100 Subject: attempt with fix URL for testing works --- include/network.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'include/network.php') diff --git a/include/network.php b/include/network.php index 3fe7f5400..ca6fa1bfc 100644 --- a/include/network.php +++ b/include/network.php @@ -78,7 +78,7 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) { @curl_setopt($ch, CURLOPT_BINARYTRANSFER,1); - // don't let curl abort the entire application + // dont let curl abort the entire application // if it throws any errors. $s = @curl_exec($ch); @@ -86,7 +86,7 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) { $base = $s; $curl_info = @curl_getinfo($ch); $http_code = $curl_info['http_code']; -// logger('fetch_url:' . $http_code . ' data: ' . $s); + logger('fetch_url:' . $http_code . ' data: ' . $s); $header = ''; // Pull out multiple headers, e.g. proxy and continuation headers @@ -129,7 +129,11 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) { function z_post_url($url,$params, $redirects = 0, $opts = array()) { - + + logger('z_post_url',LOGGER_DEBUG); + logger('z_post_url url ' . $url ,LOGGER_DEBUG); + logger('z_post_url params' . $params ,LOGGER_DEBUG); + logger('z_post_url redirects ' . $redirects ,LOGGER_DEBUG); $ret = array('return_code' => 0, 'success' => false, 'header' => "", 'body' => ""); $ch = curl_init($url); @@ -181,10 +185,12 @@ function z_post_url($url,$params, $redirects = 0, $opts = array()) { // if it throws any errors. $s = @curl_exec($ch); + logger('z_post_url s ' . $s ,LOGGER_DEBUG); $base = $s; $curl_info = curl_getinfo($ch); $http_code = $curl_info['http_code']; + logger('z_post_url http_code ' . $http_code ,LOGGER_DEBUG); $header = ''; -- cgit v1.2.3 From c5ac5544cb02aa3194c5cab2b3ab736a2e19e6eb Mon Sep 17 00:00:00 2001 From: Michael Meer Date: Thu, 30 Jan 2014 11:04:20 +0100 Subject: clean up logger commands. Placed apostrophs at the end from some comments to keep the syntax highlighting in vi working --- include/network.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'include/network.php') diff --git a/include/network.php b/include/network.php index ca6fa1bfc..1fb4beaa7 100644 --- a/include/network.php +++ b/include/network.php @@ -78,7 +78,7 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) { @curl_setopt($ch, CURLOPT_BINARYTRANSFER,1); - // dont let curl abort the entire application + // don't let curl abort the entire application' // if it throws any errors. $s = @curl_exec($ch); @@ -86,7 +86,7 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) { $base = $s; $curl_info = @curl_getinfo($ch); $http_code = $curl_info['http_code']; - logger('fetch_url:' . $http_code . ' data: ' . $s); + //logger('fetch_url:' . $http_code . ' data: ' . $s); $header = ''; // Pull out multiple headers, e.g. proxy and continuation headers @@ -130,10 +130,6 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) { function z_post_url($url,$params, $redirects = 0, $opts = array()) { - logger('z_post_url',LOGGER_DEBUG); - logger('z_post_url url ' . $url ,LOGGER_DEBUG); - logger('z_post_url params' . $params ,LOGGER_DEBUG); - logger('z_post_url redirects ' . $redirects ,LOGGER_DEBUG); $ret = array('return_code' => 0, 'success' => false, 'header' => "", 'body' => ""); $ch = curl_init($url); @@ -185,12 +181,10 @@ function z_post_url($url,$params, $redirects = 0, $opts = array()) { // if it throws any errors. $s = @curl_exec($ch); - logger('z_post_url s ' . $s ,LOGGER_DEBUG); $base = $s; $curl_info = curl_getinfo($ch); $http_code = $curl_info['http_code']; - logger('z_post_url http_code ' . $http_code ,LOGGER_DEBUG); $header = ''; -- cgit v1.2.3