barbass: поправки к учету браезра

parent 4b3249ee
...@@ -98,7 +98,7 @@ var ETY = { ...@@ -98,7 +98,7 @@ var ETY = {
if (request.withCredentials == undefined) { if (request.withCredentials == undefined) {
var old_url = window.location.href; var old_url = window.location.href;
newWin = window.open(url, '_blank'); newWin = window.open(url+'&e_typos_oldbrowser=1', '_blank');
window.parent.focus(); window.parent.focus();
//setTimeout('newWin.close()', 1000); //setTimeout('newWin.close()', 1000);
...@@ -119,8 +119,8 @@ var ETY = { ...@@ -119,8 +119,8 @@ var ETY = {
request.open("POST", url, true); request.open("POST", url, true);
request.onload = function() { request.onload = function() {
var data = request.responseText.split(' '); var data = request.responseText;
switch (data[0]) { switch (data) {
case '10robot': case '10robot':
ETY.error("red", "Есть подозрения что вы робот"); ETY.error("red", "Есть подозрения что вы робот");
break; break;
......
...@@ -35,6 +35,12 @@ if (check_header() === 0 || get_ip() === 0) { ...@@ -35,6 +35,12 @@ if (check_header() === 0 || get_ip() === 0) {
$url = trim(htmlspecialchars(substr($_REQUEST['e_typos_url'], 0, 300))); $url = trim(htmlspecialchars(substr($_REQUEST['e_typos_url'], 0, 300)));
$error_text = trim(htmlspecialchars(substr($_REQUEST['e_typos_error_text'], 0, 30))); $error_text = trim(htmlspecialchars(substr($_REQUEST['e_typos_error_text'], 0, 30)));
if (!isset($_REQUEST['e_typos_oldbrowser'])) {
$oldbrowser = 0;
} else {
$oldbrowser = intval($_REQUEST['e_typos_oldbrowser']);
}
if ($url == '' || $error_text == '' || strlen($error_text) < 5) { if ($url == '' || $error_text == '' || strlen($error_text) < 5) {
$ajax_mess = "10dataerror"; $ajax_mess = "10dataerror";
print_text($ajax_mess); print_text($ajax_mess);
...@@ -180,7 +186,10 @@ function get_ip() { ...@@ -180,7 +186,10 @@ function get_ip() {
} }
function print_text($text) { function print_text($text) {
global $oldbrowser;
echo $text; echo $text;
if ($oldbrowser == 1) {
echo " <script type='text/javascript'>window.close();</script>"; echo " <script type='text/javascript'>window.close();</script>";
}
exit; exit;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment