File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<?php
2+ $ url = trim (code::b64d ($ _GET ['url64 ' ]));
3+ if (preg_match ('/^user\.(?:login|reg)\.[^?]*\?u=user\.(?:login|reg)\./ ' , (string )$ url )) {
4+ header ('HTTP/1.1 400 Bad Request ' );
5+ die ('循环重定向 ' );
6+ }
7+
28$ tpl = str::word ($ PAGE ->ext [0 ]);
39
410// 填充POST以触发CSRF保护
814// 只对CSRF请求拒绝设置Cookie,以便主题修改不生效。
915//require SUB_DIR.'/csrf_protect.php';
1016
11- $ url = trim (code::b64d ($ _GET ['url64 ' ]));
12-
1317if (!Page::isCsrfPost () && $ PAGE ->isRegTpl ($ tpl )) {
1418 page::setCookie ('tpl ' , $ tpl , 3600 * 24 * 3650 );
1519}
Original file line number Diff line number Diff line change 11<?php
22try {
3- $ tpl = $ PAGE ->start ();
43 $ u = $ _GET ['u ' ];
54 if ($ u == '' ) $ u = $ _GET ['url ' ];
5+ if (preg_match ('/^user\.(?:login|reg)\./ ' , (string )$ u )) {
6+ header ('HTTP/1.1 400 Bad Request ' );
7+ die ('循环重定向 ' );
8+ }
9+
10+ $ tpl = $ PAGE ->start ();
611 if ($ u == '' ) $ u = 'index.index. ' . $ PAGE ->bid ;
712 $ tpl ->assign ('u ' , $ u );
813 if (!$ _POST ['go ' ]) {
Original file line number Diff line number Diff line change 11<?php
22try {
3- $ tpl = $ PAGE ->start ();
43 $ u = $ _GET ['u ' ];
4+ if (preg_match ('/^user\.(?:login|reg)\./ ' , (string )$ u )) {
5+ header ('HTTP/1.1 400 Bad Request ' );
6+ die ('循环重定向 ' );
7+ }
8+
9+ $ tpl = $ PAGE ->start ();
510 if ($ u == '' ) $ u = 'index.index. ' . $ PAGE ->bid ;
611 $ tpl ->assign ('u ' , $ u );
712
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ Disallow: /q.php/user.login*
33Disallow: /q.php/user.reg*
44Disallow: /q.php/addin.chat*
55Disallow: /q.php/addin.speedtest*
6+ Disallow: /q.php/link.tpl*
67Allow: /q.php/addin*
78Allow: /q.php/admin*
89Allow: /q.php/api*
You can’t perform that action at this time.
0 commit comments