From efdb6634a2b59e94cb43d97c97a1e040ce0151e7 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 8 Mar 2019 21:51:23 -0500 Subject: [PATCH 1/6] Add defaults() to term parameter in mod/filerm - Addresses part of https://github.com/friendica/friendica/issues/6338#issuecomment-470681556 --- mod/filerm.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/filerm.php b/mod/filerm.php index b1f9f8d74..9013dd62b 100644 --- a/mod/filerm.php +++ b/mod/filerm.php @@ -12,7 +12,7 @@ function filerm_content(App $a) exit(); } - $term = XML::unescape(trim($_GET['term'])); + $term = XML::unescape(trim(defaults($_GET, 'term', ''))); $cat = XML::unescape(trim(defaults($_GET, 'cat', ''))); $category = (($cat) ? true : false); From 60c8668aca0d596319ca02dcfbabde7028c9b572 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 8 Mar 2019 21:53:44 -0500 Subject: [PATCH 2/6] Add defaults() to url parameter in mod/follow - Add error redirection to /contact when url param is empty - Addresses part of https://github.com/friendica/friendica/issues/6338#issuecomment-470681556 --- mod/follow.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mod/follow.php b/mod/follow.php index abde4abd0..404c79ea1 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -60,7 +60,11 @@ function follow_content(App $a) } $uid = local_user(); - $url = Strings::escapeTags(trim($_REQUEST['url'])); + $url = Strings::escapeTags(trim(defaults($_REQUEST, 'url', ''))); + + if (!$url) { + $a->internalRedirect($return_path); + } $submit = L10n::t('Submit Request'); From 6f07bfb772047d96ee3ab26025a8d89c50d15754 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 8 Mar 2019 21:57:18 -0500 Subject: [PATCH 3/6] Add missing fields to Register::getPending() - Addresses https://github.com/friendica/friendica/issues/6338#issuecomment-470882973 --- src/Model/Register.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Model/Register.php b/src/Model/Register.php index c2dd96def..8a03f379a 100644 --- a/src/Model/Register.php +++ b/src/Model/Register.php @@ -25,7 +25,7 @@ class Register public static function getPending() { $stmt = DBA::p( - "SELECT `register`.*, `contact`.`name`, `user`.`email` + "SELECT `register`.*, `contact`.`name`, `contact`.`url`, `contact`.`micro`, `user`.`email` FROM `register` INNER JOIN `contact` ON `register`.`uid` = `contact`.`uid` INNER JOIN `user` ON `register`.`uid` = `user`.`uid`" From a1f7c1215d60a8cfc510bb155c4365575c069e50 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 8 Mar 2019 22:04:38 -0500 Subject: [PATCH 4/6] Fix typo to ensure config backward compatibility in frio/php/scheme.php --- view/theme/frio/php/scheme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/theme/frio/php/scheme.php b/view/theme/frio/php/scheme.php index 9e3f610cd..f3150b52f 100644 --- a/view/theme/frio/php/scheme.php +++ b/view/theme/frio/php/scheme.php @@ -25,7 +25,7 @@ function get_scheme_info($scheme) $theme = \get_app()->getCurrentTheme(); $themepath = 'view/theme/' . $theme . '/'; if (empty($scheme)) { - $scheme = PConfig::get(local_user(), 'frio', 'scheme', PConfig::get(local_user(), 'frio', 'scheme')); + $scheme = PConfig::get(local_user(), 'frio', 'scheme', PConfig::get(local_user(), 'frio', 'schema')); } $info = [ From d6a607558b77dcb5dab077421455c01c444d975b Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 8 Mar 2019 22:05:14 -0500 Subject: [PATCH 5/6] Add frio.scheme pconfig value type check - Addresses https://github.com/friendica/friendica/issues/6338#issuecomment-471118589 --- view/theme/frio/php/default.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/theme/frio/php/default.php b/view/theme/frio/php/default.php index b9600cc22..29d7ab53c 100644 --- a/view/theme/frio/php/default.php +++ b/view/theme/frio/php/default.php @@ -44,7 +44,7 @@ $is_singleuser_class = $is_singleuser ? "is-singleuser" : "is-not-singleuser"; // It makes mobile Chrome UI match Frio's top bar color. $uid = Profile::getThemeUid($a); $scheme = PConfig::get($uid, 'frio', 'scheme', PConfig::get($uid, 'frio', 'schema')); - if ($scheme && ($scheme != '---')) { + if ($scheme && is_string($scheme) && $scheme != '---') { if (file_exists('view/theme/frio/scheme/' . $scheme . '.php')) { $schemefile = 'view/theme/frio/scheme/' . $scheme . '.php'; require_once $schemefile; From 5f2a66e66c44214a0f5c8727875f0430736234af Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 8 Mar 2019 22:09:41 -0500 Subject: [PATCH 6/6] Add check for EXIF data existence in Object/Image - Addresses https://github.com/friendica/friendica/issues/6338#issuecomment-467121955 --- src/Object/Image.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Object/Image.php b/src/Object/Image.php index 45c8bedea..66be78ad4 100644 --- a/src/Object/Image.php +++ b/src/Object/Image.php @@ -447,7 +447,7 @@ class Image return; } - $ort = $exif['IFD0']['Orientation']; + $ort = isset($exif['IFD0']['Orientation']) ? $exif['IFD0']['Orientation'] : 1; switch ($ort) { case 1: // nothing