Closed wehowski closed 1 year ago
I can't reproduce it. registry.frdl.de does not work on IE at all (the menu looks funny, which means no JavaScript is loaded). JavaScript console shows that a webfan JavaScript has a JavaScript syntax error). Therefore, in OIDWHOIS I don't have any content. Can you please show a screenshot of the problem?
Hello Daniel, unfortunatly there is nothing to see on a screenshot as everything works and looks fine!!! Except if I click the button "Open in web-browser" the link resolves to https://webfan.de/apps/registry/index.phpplugins/viathinksoft/publicPages/100_whois/whois/webwhois.php?query=oid%3A1.3.6.1.4.1 and redirects to an error page.
I am using Microsoft Edge Version 113.0.1774.50, other browsers work fine.
However as this is just a minor bug I can live with it, less important.
Yes, you can see it in a screenshot:
Ok, I tried it with Edge now. But I cannot reproduce it.
For me, the URL is https://registry.frdl.de/plugins/viathinksoft/publicPages/100_whois/whois/webwhois.php?query=oid%3A1.3.6.1.4.1
I can only reproduce the error at the canonical: https://webfan.de/apps/registry/index.php?goto=oidplus%3Awhois On registry.frdl.de it is working.
Thank you. With the canonical URL I can reproduce that on Safari . It should be independent of the web browser, because IIRC the URL comes from the server side webpath() method.
Bug seems to be in JavaScript actually:
OIDplusPagePublicWhois.js
$("#whois_url_bar")[0].innerText = getSystemUrl() + 'plugins/viathinksoft/publicPages/100_whois/whois/webwhois.php?query=' + encodeURIComponent(query);
_oidplusbase.js
function getSystemUrl(relative) {
var url = new URL(window.location.href);
if (relative) {
return url.pathname;
} else {
return url.href.substr(0, url.href.length-url.search.length);
}
}
OIDplusPagePublicWhois.js is the only file that makes use of getSystemUrl()
.
What I noticed / TODO:
relative
is not defined, so this could be the reason why browsers handle it differently? TODO: Don't let it be undefined. (Fixed in SVN Rev 1287, file oidplus_base.js)getSystemUrl()
works correctly. => TODO (Fixed in SVN Rev 1287, file OIDplus.class.php, error in function canonicalUrl()
)Fixed method:
function getSystemUrl(relative) {
relative = (typeof relative === 'undefined') ? false : relative; // do not translate
var url = new URL(window.location.href);
var res = relative ? url.pathname : url.href.substr(0, url.href.length-url.search.length);
if (res.endsWith("index.php")) res = res.substring(0, res.lastIndexOf('/')) + "/";
return res;
}
Hello Daniel, where do I find oidplus_base.js? Does it help to check if '/' === url.substr(0,1) ? As the canonical end with index.php and its a index file could remove index.php from canonical?
oidplus_base.js is in includes/ . Did you try my fix I have written above?
Question to you:
What should Does it help to check if '/' === url.substr(0,1) ?
fix in your suggestion?
How did index.php come from in the first place? The canonical URL should not contain index.php at all.
Thank you!!!
<link rel="canonical" href="https://webfan.de/apps/registry/index.php?goto=oidplus%3Awhois">
it contains index.php?
However, the links are working now!Fixed this issue on serverside in canonicalURL()
:
// Third part: File name
$tmp = $_SERVER['SCRIPT_NAME'];
$tmp = rtrim($tmp, 'index.php'); // <-- added
$tmp = explode('/',$tmp);
$tmp = end($tmp);
Issues fixed in SVN Rev 1287
One last check (TODO): Check if there are other places where "index.php" is automatically added to the URL! --> oidplus_base.js contains index.php?goto= . That's not good => will be continued in #15
https://registry.frdl.de/?goto=oidplus%3Awhois The Link/Button "Open in Browser" does not work in IE.
Chrome: OK FF: OK IE: Error with Slash / Link Edit: tested with Edge