有时我查看我的MySQL日志,偶然发现一些AES_ENCRYPT/AES_DECRYPT请求以明文显示密码.
如果我在PHP中创建日志,我将能够删除它们.
但是MySQL通用/慢速查询日志呢?他们的选项是否可用,或者是否可以设置一个不会保存在日志中的mySQL变量?
我想了解如何<base href="" />
为我的网络爬虫使用一个值,所以我测试了几个主要浏览器的组合,最后发现了一些我不明白的双斜线.
如果您不喜欢阅读所有内容,请跳转到D和E的测试结果.所有测试的演示:http:
//gutt.it/basehref.php
我的测试结果一步一步调用http://example.com/images.html
:
A - 多个基数href
<html>
<head>
<base target="_blank" />
<base href="http://example.com/images/" />
<base href="http://example.com/" />
</head>
<body>
<img src="/images/image.jpg">
<img src="image.jpg">
<img src="./image.jpg">
<img src="images/image.jpg"> not found
<img src="/image.jpg"> not found
<img src="../image.jpg"> not found
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
结论
<base>
有href
计数/
目标根开始的源../
去一个文件夹 B - 没有斜线
<html>
<head>
<base href="http://example.com/images" />
</head>
<body>
<img src="/images/image.jpg">
<img src="image.jpg"> not found
<img …
Run Code Online (Sandbox Code Playgroud) 我的测试用例如下:
echo crypt('string', '_....salt');//error
echo crypt('string', '_A...salt');//fast
echo crypt('string', '_AAAAsalt');//slow
Run Code Online (Sandbox Code Playgroud)
解释如http://www.php.net/manual/en/function.crypt.php所述:
CRYPT_EXT_DES - 扩展的基于 DES 的哈希。“salt”是一个 9 个字符的字符串,由下划线后跟 4 个字节的迭代计数和 4 个字节的 salt 组成。这些被编码为可打印字符,每个字符 6 位,最低有效字符在前。值 0 到 63 编码为“./0-9A-Za-z”。在 salt 中使用无效字符将导致 crypt() 失败。
点是可打印字符,那么为什么它会返回错误呢?哪个“顺序”适用于所使用的字符,导致“AAAA”比“A...”有更多的迭代次数?
我想使用tablesorter插件:http: //tablesorter.com/docs/
使用thead插件:http: //www.asual.com/jquery/thead/
它到目前为止工作,但是thead插件在tablesorter添加排序函数之前使用源代码,因此如果我们向下滚动,则"flying thead"中缺少sort函数.
如何通过tablesorter将修改后的html源分配给thead?
我的代码:
$(document).ready(function() {
$.tablesorter.addParser({
id: "axis",
is: function(s) {
return false;
},
format: function(s,table,cell) {
return $(cell).attr("axis");
},
type: "numeric"
});
$.tablesorter.addParser({
id: "floatval",
is: function(s) {
return false;
},
format: function(s) {
return s.replace(/\./g,"").replace(/,/g,".").replace(/[^0-9-.]/g, "");
},
type: "numeric"
});
$.tablesorter.addParser({
id: "germandate",
is: function(s) {
return false;
},
format: function(s) {
var a = s.split(".");
a[1] = a[1].replace(/^[0]+/g,"");
return new Date(a.reverse().join("/")).getTime();
},
type: "numeric"
});
$("#ax_overview").tablesorter({
headers: { …
Run Code Online (Sandbox Code Playgroud) 假设我们preg_replace
在数百万个帖子字符串上使用它:
function makeClickableLinks($s) {
return preg_replace('@(https?://([-\w\.]+[-\w])+(:\d+)?(/([\w/_\.#-]*(\?\S+)?[^\.\s])?)?)@', '<a href="$1" target="_blank">$1</a>', $s);
}
Run Code Online (Sandbox Code Playgroud)
假设所有帖子中只有 10% 包含链接,strpos($string, 'http') !== false
在调用之前检查会更快preg_replace()
吗?如果是这样,为什么?不在preg_replace()
内部执行一些预测试?
php ×3
html ×2
aes ×1
crypt ×1
des ×1
html-head ×1
javascript ×1
jquery ×1
mysql ×1
preg-replace ×1
regex ×1
security ×1
strpos ×1
tablesorter ×1