Allow sanity_check.php to be called directly

I was playing with different scenarios of deploying tt-rss, so I needed to look at the sanity check a lot. I noticed it tries to use format_error() function, which is defined in include/controls.php, but it fails to require it. I propose the following patch to enable sanity_check to be called independently:

here’s the patch, but I could open a proper PR on gogs too. my id is the same gdamjan

diff --git a/include/sanity_check.php b/include/sanity_check.php
index 86dc7a5f0..e4ace0ee2 100755
--- a/include/sanity_check.php
+++ b/include/sanity_check.php
@@ -14,6 +14,7 @@
         * If you come crying when stuff inevitably breaks, you will be mocked and told
         * to get out. */
 
+       require_once "controls.php";
        function make_self_url() {
                $proto = is_server_https() ? 'https' : 'http';

ps. I haven’t come to it, but probably include/functions.php should be required too.

During normal operation this all works as expected, no? So the change would only benefit your particular use-case?

why not open index.php instead which would display that same exact error? :face_with_raised_eyebrow:

e: tbh i would prefer to summarily remove installer and sanity checks instead

During normal operation this all works as expected, no? So the change would only benefit your particular use-case?

It will benefit me for sure, maybe someone else debugging tt-rss, or trying to improve on tt-rss.

why not open index.php instead which would display that same exact error? :face_with_raised_eyebrow:

because index.php doesn’t show any errors, it just enters some redirect loop - but that’s another topic.

e: tbh i would prefer to summarily remove installer and sanity checks instead

that’s not a bad option either :slight_smile:

i’m not sure how you managed to achieve this.

i’m not sure how you managed to achieve this.

well that’s what I am investigating. it seems that the call to /backend.php returns a {"error":{"code":6,"message":null}} json, so it is as if somehow my session gets invalidated.

Anyway, I don’t understand the need to become all defensive, and to negate ones experience out of hand. I didn’t come here to take anything of you. At worst I can help.

going by the rest of your posts, i find it highly unlikely.

i’m also not going to consider merging any changes coming from you specifically because it’s fairly obvious that you have no idea what you’re doing.