马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
未经测试,自测
template\default\forum\post.htm
搜索
- <script>
- (function() {
- var form = document.getElementById('postform');
- if (!form) return;
- var originalSubmitHandler = form.onsubmit;
- var isProcessing = false;
- form.onsubmit = function(e) {
- if (isProcessing) return false;
- isProcessing = true;
- try {
- var messageBox = document.querySelector('textarea[name="message"]');
- if (!messageBox) {
- console.error('未找到文本域');
- return false;
- }
- // 终极正则(精确匹配所有网盘)
- var pattern = /链接[::]\s*((?:https?:\/\/)?(?:pan\.baidu\.com\/s\/|pan\.quark\.cn\/s\/|www\.alipan\.com\/s\/|pan\.xunlei\.com\/s\/|www\.115\.com\/\w+\/folder\/)[a-zA-Z0-9_\/-]+)\s+提取码[::]\s*(\w{4})/gi;
- messageBox.value = messageBox.value.replace(pattern, '[hide]链接: $1 提取码: $2[/hide]');
- if (originalSubmitHandler) {
- return originalSubmitHandler.call(this, e);
- }
- } catch (err) {
- console.error('提交异常:', err);
- isProcessing = false;
- return false;
- } finally {
- isProcessing = false;
- }
- };
- })();
- </script>
复制代码
|
|