From 4cb2c55025c2ca56034117629af4d26856b9c7e8 Mon Sep 17 00:00:00 2001 From: Joakim Date: Fri, 5 Jul 2013 20:34:38 +0200 Subject: Filter test from web interface now replicates behaviour from pull #167 --- include/functions.php | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/functions.php b/include/functions.php index 355eec2cd..0eceed623 100644 --- a/include/functions.php +++ b/include/functions.php @@ -3958,6 +3958,7 @@ $reg_qpart = "REGEXP"; foreach ($filter["rules"] AS $rule) { + $rule['reg_exp'] = str_replace('/', '\/', $rule["reg_exp"]); $regexp_valid = preg_match('/' . $rule['reg_exp'] . '/', $rule['reg_exp']) !== FALSE; -- cgit v1.2.3 From 04a8c2065f73fd425a61dc55b4735de866fc01c5 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 6 Jul 2013 12:05:52 +0400 Subject: better error reporting in session validation --- include/sessions.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/sessions.php b/include/sessions.php index 423ef0eda..66214afe7 100644 --- a/include/sessions.php +++ b/include/sessions.php @@ -62,11 +62,17 @@ return false; } - if ($_SESSION["ref_schema_version"] != session_get_schema_version(true)) + if ($_SESSION["ref_schema_version"] != session_get_schema_version(true)) { + $_SESSION["login_error_msg"] = + __("Session failed to validate (schema version changed)"); return false; + } - if (sha1($_SERVER['HTTP_USER_AGENT']) != $_SESSION["user_agent"]) + if (sha1($_SERVER['HTTP_USER_AGENT']) != $_SESSION["user_agent"]) { + $_SESSION["login_error_msg"] = + __("Session failed to validate (user agent changed)"); return false; + } if ($_SESSION["uid"]) { $result = Db::get()->query( @@ -74,11 +80,19 @@ // user not found if (Db::get()->num_rows($result) == 0) { + + $_SESSION["login_error_msg"] = + __("Session failed to validate (user not found)"); + return false; } else { $pwd_hash = Db::get()->fetch_result($result, 0, "pwd_hash"); if ($pwd_hash != $_SESSION["pwd_hash"]) { + + $_SESSION["login_error_msg"] = + __("Session failed to validate (password changed)"); + return false; } } -- cgit v1.2.3 From c722c0be1788c99f54782cb44295bfd4a3085bad Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 7 Jul 2013 11:23:59 +0400 Subject: rewrite_relative_url: don't touch stuff which has sheme in it (closes #738) --- include/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/functions.php b/include/functions.php index 0eceed623..bcded7e5f 100644 --- a/include/functions.php +++ b/include/functions.php @@ -3788,7 +3788,7 @@ * @return string Absolute URL */ function rewrite_relative_url($url, $rel_url) { - if (strpos($rel_url, "magnet:") === 0) { + if (strpos($rel_url, ":") !== false) { return $rel_url; } else if (strpos($rel_url, "://") !== false) { return $rel_url; -- cgit v1.2.3 From 47fecba235400e0d7a5a7c54c9ff201c0840deec Mon Sep 17 00:00:00 2001 From: justauser Date: Sun, 7 Jul 2013 13:53:23 -0400 Subject: changes to add hook_query_headlines --- include/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/functions.php b/include/functions.php index 355eec2cd..397605c5a 100644 --- a/include/functions.php +++ b/include/functions.php @@ -2579,7 +2579,7 @@ } } - $content_query_part = "content as content_preview, cached_content, "; + $content_query_part = "content, content as content_preview, cached_content, "; if (is_numeric($feed)) { -- cgit v1.2.3