Skip to content

Instantly share code, notes, and snippets.

@yungke
Created April 24, 2015 04:08
Show Gist options
  • Save yungke/92836b1a018b932b7b61 to your computer and use it in GitHub Desktop.
Save yungke/92836b1a018b932b7b61 to your computer and use it in GitHub Desktop.
Discuz X3.2 facebook 連結至 discuz 的錯誤修正
private function _xss_check() {
$_SERVER['REQUEST_URI'] = preg_replace("/(&|\?)fb_action(.*?)$/i", "", $_SERVER['REQUEST_URI']);
$temp = strtoupper(urldecode(urldecode($_SERVER['REQUEST_URI'])));
if(strpos($temp, '<') !== false || strpos($temp, '"') !== false || strpos($temp, 'CONTENT-TRANSFER-ENCODING') !== false) {
system_error('request_tainting');
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment