关于对discuz.gtimg.cn不明代码的解决方法
今天看了下一个频道的页面,发现有js什么的冲突代码
最近用排除方法 是底部
这代码引起的,既然在底部那就很好找,找到模版 footer.htm 里面是用 调用的
之前没有这代码的,打了0339补丁就有了,那就去0339补丁里搜索这代码
在 source/function/function_cloud.php 里有这么一句赤裸裸的代码,为什么我叫他赤裸裸
一 因为这gtimg.cn跟官方,压跟没有联系
二 这js代码还会影响我们js的效果
三 下载这个js还使用一个eval(function(p,a,c,k,e,d)加密
-----------------------------------------------------------------------------------------------
解密后得到的代码
最近用排除方法 是底部
这代码引起的,既然在底部那就很好找,找到模版 footer.htm 里面是用 调用的
之前没有这代码的,打了0339补丁就有了,那就去0339补丁里搜索这代码
在 source/function/function_cloud.php 里有这么一句赤裸裸的代码,为什么我叫他赤裸裸
一 因为这gtimg.cn跟官方,压跟没有联系
二 这js代码还会影响我们js的效果
三 下载这个js还使用一个eval(function(p,a,c,k,e,d)加密
-----------------------------------------------------------------------------------------------
解密后得到的代码
-
var clearTips; DiscuzCloudNameSpace = new Object(); DiscuzCloudNameSpace.register = function(fullName) { try { var nsArray = fullName.split("."); var strNS = ""; var strEval = ""; for (var i = 0; i < nsArray.length; i++) { if (strNS.length > 0) strNS += "."; strNS += nsArray; strEval += " if (typeof(" + strNS + ") =='undefined') " + strNS + " = new Object(); " }; if (strEval != "") eval(strEval) } catch(e) { alert(e.message) } }; DiscuzCloudNameSpace.register('DiscuzCloud'); DiscuzCloud.JSONP = (function() { var counter = 0, head, query, key, window = this; function load(url) { script = document.createElement('script'), done = false; script.src = url; script.charset = 'UTF-8'; script.async = true; script.onload = script.onreadystatechange = function() { if (!done && (!this.readyState || this.readyState === "loaded" || this.readyState === "complete")) { done = true; script.onload = script.onreadystatechange = null; if (script && script.parentNode) { script.parentNode.removeChild(script) } } }; if (!head) { head = document.getElementsByTagName('head')[0] }; head.appendChild(script) }; function jsonp(url, params, callback) { if (url.indexOf('?') > -1) { query = '&' } else { query = '?' }; params = params || {}; for (key in params) { if (params.hasOwnProperty(key)) { query += encodeURIComponent(key) + "=" + encodeURIComponent(params[key]) + "&" } }; var jsonp = 'discuzTipsCallback'; window[jsonp] = function(data) { callback(data); try { delete window[jsonp] } catch(e) {} window[jsonp] = null }; load(url + query + "callback=" + jsonp); return jsonp }; return { get: jsonp } } ()); DiscuzCloud.htmlspecialchars = function(string, quote_style, charset, double_encode) { var optTemp = 0, i = 0, noquotes = false; if (typeof quote_style === 'undefined' || quote_style === null) { quote_style = 2 }; string = string.toString(); if (double_encode !== false) { string = string.replace(/&/g, '&') }; string = string.replace(//g, '>'); var OPTS = { 'ENT_NOQUOTES': 0, 'ENT_HTML_QUOTE_SINGLE': 1, 'ENT_HTML_QUOTE_DOUBLE': 2, 'ENT_COMPAT': 2, 'ENT_QUOTES': 3, 'ENT_IGNORE': 4 }; if (quote_style === 0) { noquotes = true }; if (typeof quote_style !== 'number') { quote_style = [].concat(quote_style); for (i = 0; i < quote_style.length; i++) { if (OPTS[quote_style] === 0) { noquotes = true } else if (OPTS[quote_style]) { optTemp = optTemp | OPTS[quote_style] } }; quote_style = optTemp }; if (quote_style & OPTS.ENT_HTML_QUOTE_SINGLE) { string = string.replace(/'/g, ''') }; if (!noquotes) { string = string.replace(/"/g, '"') }; return string }; DiscuzCloud.setCookie = function(name, value, sec) { if (typeof(sec) == 'undefined') { sec = 86400000; } else { sec = sec * 1000 }; var expires = new Date(); expires.setTime(expires.getTime() + sec); document.cookie = name + '=' + escape(value) + '; expires=' + expires.toGMTString() }; DiscuzCloud.getCookie = function(name) { var cookie_start = document.cookie.indexOf(name); var cookie_end = document.cookie.indexOf(';', cookie_start); return cookie_start == -1 ? '': unescape(document.cookie.substring(cookie_start + name.length + 1, (cookie_end > cookie_start ? cookie_end: document.cookie.length))) }; DiscuzCloud.$ = function(id) { return document.getElementById(id) }; DiscuzCloud.Tips = function(sId, version, release, api, founder, fix, sUrl, sCharset, ts, sig, adminId, groupId, uid, openId) { this.sId = sId; this.sUrl = sUrl; this.version = version; this.release = release; this.api = api; this.founder = founder; this.fix = fix; this.clientWidth = document.documentElement.clientWidth; this.clientHeight = document.documentElement.clientHeight; this.discuzTips = DiscuzCloud.$('discuz_tips'); newDate = new Date(); this.url = 'http://cp.discuz.qq.com/tips/get?rand=' + newDate.getDate() + newDate.getHours(); this.secret = ''; this.tipsId = ''; this.cacheKey = ''; this.sendTime = ''; this.sCharset = sCharset; if (typeof(document.characterSet) == 'undefined') { this.browserCharset = document.charset } else { this.browserCharset = document.characterSet }; if (discuzTipsCVersion == '2') { this.adminId = adminId; this.groupId = groupId; this.uid = uid; this.openId = openId }; this.ts = ts; this.sig = sig }; DiscuzCloud.Tips.prototype.show = function() { if (discuzTipsCVersion == '2' && this.adminId != 1) { return false }; if (this.checkManyou()) { &
免责声明:本站所有文章和图片均来自用户分享和网络收集,文章和图片版权归原作者及原出处所有,仅供学习与参考,请勿用于商业用途,如果损害了您的权利,请联系网站客服处理。
热门教程
discuz电脑版、手机版去除标题title中的PoweredbyDisc2018-12-27
Discuz 触屏手机版支持视频播放的方法2018-12-27
discuz手机版支持视频播放的修改方法2018-12-27
Discuz! 程序 X3.2、X3.3升级3.4教程2018-12-27
discuz X3以及X3.4论坛搬家完美详细教程2019-01-02
怎么开启手机版2018-12-25
去掉Discuz论坛底部的Powered 等版权信息2018-12-27
discuz! x3.4插件位置DZ论坛X3版本插件在哪个文件夹?2018-12-26
Mysql修改端口号后织梦dedecms的修改方法2018-12-27
Discuz!X3.2论坛实现全站HTTPS终极方法教程2018-12-28