New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting notice "Undefined index: host" when running PHP command line scripts #57

Open
SeBsZ opened this Issue Aug 7, 2018 · 7 comments

Comments

Projects
None yet
4 participants
@SeBsZ

SeBsZ commented Aug 7, 2018

class-disqus-admin.php has a filter for the get_rest_url function

public function dsq_filter_rest_url( $rest_url )

The issue is line 167 in this function:
$current_host = $_SERVER['HTTP_HOST'];

When running PHP scripts on the command line (we have workers running through Supervisord) HTTP_HOST is undefined as there is no web server.

This generates a PHP notice every time:

PHP Notice: Undefined index: host in /srv/www/htdocs/my_website/public/wp-content/plugins/disqus-comment-system/admin/class-disqus-admin.php on line 162

Can a check be added if this variable exists before it is used, or can it be suppressed?

I tried to prevent Disqus from loading using the dsq_can_load filter but that has no effect. Alternatively I could try to prevent the whole plugin from running.

@jaryszek

This comment has been minimized.

Show comment
Hide comment
@jaryszek

jaryszek Aug 7, 2018

jaryszek commented Aug 7, 2018

@gddh

This comment has been minimized.

Show comment
Hide comment
@gddh

gddh Aug 13, 2018

Contributor

@SeBsZ working to get this done. Thank you for your patience!

@jaryszek Apologies for the delay. Working on this now

Contributor

gddh commented Aug 13, 2018

@SeBsZ working to get this done. Thank you for your patience!

@jaryszek Apologies for the delay. Working on this now

@jaryszek

This comment has been minimized.

Show comment
Hide comment
@jaryszek

jaryszek Aug 14, 2018

jaryszek commented Aug 14, 2018

@gddh

This comment has been minimized.

Show comment
Hide comment
@gddh

gddh Aug 14, 2018

Contributor

@jaryszek I'll do my best to get it done and to get some other issues fixed given my constraints. I cannot guarantee I can get to them, but I will try my best. Is that ok Jacek?

Again thank you for your patience and sticking with this Jacek!

Contributor

gddh commented Aug 14, 2018

@jaryszek I'll do my best to get it done and to get some other issues fixed given my constraints. I cannot guarantee I can get to them, but I will try my best. Is that ok Jacek?

Again thank you for your patience and sticking with this Jacek!

@jaryszek

This comment has been minimized.

Show comment
Hide comment
@jaryszek

jaryszek Aug 15, 2018

jaryszek commented Aug 15, 2018

@dlin168

This comment has been minimized.

Show comment
Hide comment
@dlin168

dlin168 Aug 17, 2018

You are definitely very reasonable and perceptive Jacek! I hope you will also understand that there are other parts of Disqus that we are working on as well to better serve you and other members of the Disqus community. At the same time we want to address these problems, so that is why we want to get to them, but cannot guarantee it.

Do I make sense Jacek? Please let me know if I am being unclear!

Again, thank you for your patience with us Jacek.

dlin168 commented Aug 17, 2018

You are definitely very reasonable and perceptive Jacek! I hope you will also understand that there are other parts of Disqus that we are working on as well to better serve you and other members of the Disqus community. At the same time we want to address these problems, so that is why we want to get to them, but cannot guarantee it.

Do I make sense Jacek? Please let me know if I am being unclear!

Again, thank you for your patience with us Jacek.

@jaryszek

This comment has been minimized.

Show comment
Hide comment
@jaryszek

jaryszek Aug 17, 2018

jaryszek commented Aug 17, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment