-
Notifications
You must be signed in to change notification settings - Fork 25
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
FIX: "Undefined index: HTTP_HOST" for no web server #60
Conversation
…ests to ensure dsq_filter_rest_url does not error when _SERVER host is not set.
…ests to ensure dsq_filter_rest_url does not error when _SERVER host is not set.
…ess-plugin into null_guard_dsq_filter
…ess-plugin into null_guard_dsq_filter
…ess-plugin into null_guard_dsq_filter
Hi there is no fix
W dniu pt., 14.12.2018 o 16:22 SeBsZ <[email protected]> napisał(a):
… Hi @gddh <https://github.com/gddh> and @wedamija
<https://github.com/wedamija> ,
can this fix please be released in a new release? We're using composer
with wpackagist and we can't currently pull in the version of
disqus-wordpress-plugin that contains this fix. Thank you!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#60 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AavzWPH_c0UV9gm9kzM7qjBDpTSH-8huks5u48JGgaJpZM4WL0VU>
.
|
o wow they fix it after one year ? :)
pt., 14 gru 2018 o 16:59 SeBsZ <[email protected]> napisał(a):
… @jaryszek <https://github.com/jaryszek> what do you mean? It's right here
in this thread #60
<#60>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#60 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AavzWDT0_Qyu2iPRUlOWe6oMx8Yy7lJpks5u48rmgaJpZM4WL0VU>
.
|
Actually this was fixed in less than 1 month from me opening the issue. It just hasn't been released in a proper release. |
@sebszz i have emails from other people that it was not working more than 1
year, people changed their commenting system.
I was close to change it also but with a little luck i am still with
disqus.
pt., 14 gru 2018 o 17:03 SeBsZ <[email protected]> napisał(a):
… Actually this was fixed in less than 1 month from me opening the issue. It
just hasn't been released in a proper release.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#60 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AavzWFebjfiRoumq42eGC6y1sDg-h0-bks5u48vHgaJpZM4WL0VU>
.
|
Let me ping some folks who can help push this through. |
@gddh, I realized the fix is not entirely complete. Even with this fix I kept getting more notices:
Here's my suggested fix, where I check for the presence of the 'host' key in $rest_url as well:
|
@gddh please implement this fix with the latest update
pon., 31 gru 2018 o 12:05 SeBsZ <[email protected]> napisał(a):
… @gddh <https://github.com/gddh>, I realized the fix is not entirely
complete. Even with this fix I kept getting more notices:
[31-Dec-2018 11:04:37 UTC] PHP Notice: Undefined index: host in
.../wp-content/plugins/disqus-comment-system/admin/class-disqus-admin.php
on line 163
Here's my suggested fix, where I check for the presence of the 'host' key
in $rest_url as well:
`
public function dsq_filter_rest_url( $rest_url ) {
$rest_url_parts = parse_url( $rest_url );
if ( array_key_exists( 'host', $rest_url_parts ) ) {
$rest_host = $rest_url_parts['host'];
if (array_key_exists('port', $rest_url_parts)) {
$rest_host .= ':' . $rest_url_parts['port'];
}
$current_host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $rest_host;
if ($rest_host !== $current_host) {
$rest_url = preg_replace('/' . $rest_host . '/', $current_host, $rest_url, 1);
}
}
return $rest_url;
}
`
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#60 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AavzWL6f3Fui7RWB0XLycUX9T0MsQWcZks5u-e9tgaJpZM4WL0VU>
.
|
Thanks @archon810 and @SeBsZ. Here is the suggested fix which we will pull in soon 03c66dd. In the meantime, feel free to create your own PR and ping me on it if you would prefer to be the author. Do you have reproduction steps for forcing |
Hi @dmatt,
We're setting these dynamically in wp-config, not in wp_options, so when there is no host present, Disqus will throw the notice. |
Thanks for that tip @SeBsZ, I've reproduced the notice now and will ping you when the fix is pulled in. |
dsq_filter_rest_url
dsq_filter_rest_url
does not error when_SERVER
host is not set.Address: #57