: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
<div id="disqus_thread"></div>
var QueryString = function () {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if (typeof query_string[pair[0]] === "undefined") {
query_string[pair[0]] = decodeURIComponent(pair[1]);
} else if (typeof query_string[pair[0]] === "string") {
var arr = [ query_string[pair[0]],decodeURIComponent(pair[1]) ];
query_string[pair[0]] = arr;
query_string[pair[0]].push(decodeURIComponent(pair[1]));
var url = QueryString.url;
var identifier = QueryString.identifier;
var disqus_name = QueryString.disqus_name;
var disqus_title = QueryString.disqus_title;
var disqus_config = function () {
this.page.title = disqus_title;
this.page.identifier = identifier || url;
const pattern = /https:\/\/[\w-]+\.disqus\.com/;
const matches = disqus_name.match(pattern);
var d = document, s = d.createElement('script');
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
function checkSizeChange() {
var viewportHeight = window.innerHeight;
var contentHeight = document.getElementById('disqus_thread').clientHeight;
if (viewportHeight !== contentHeight && contentHeight > 100) {
window.parent.postMessage({
var mutationObserverAvailable = typeof window.MutationObserver === 'function';
function bindObserver() {
frames = document.getElementsByTagName('iframe');
for (var i=0; i < frames.length; ++i) {
framename = frame.getAttribute("name");
if ( framename && /dsq/.test(framename) ) {
// check the size now since the frame is now available
var resizeObserver = new MutationObserver(checkSizeChange);
resizeObserver.observe(frame, {
attributeFilter: ['style']
// if the frame is not available yet try again later
if (foundframe === false) {
setTimeout(bindObserver, 200);
// use mutation observers to quickly change the size of the iframe
if (mutationObserverAvailable) {
// also check periodically for the size of the frame
setInterval(checkSizeChange, mutationObserverAvailable ? 5000 : 500);