Correctly calls “submit” where it didn’t; fixed a flaw; bumped version to 0.3.6

This commit is contained in:
pezcurrel 2024-01-09 19:55:16 +01:00
parent 6c38b489ff
commit fa6a00ebd3

View file

@ -31,7 +31,7 @@ require 'lib/ght.php';
require 'lib/booltostr.php'; require 'lib/booltostr.php';
const SNAME='Verbose'; const SNAME='Verbose';
const SVERS='0.3.5'; const SVERS='0.3.6';
const SREPO='https://git.lattuga.net/pongrebio/verbose'; const SREPO='https://git.lattuga.net/pongrebio/verbose';
const DEFAC=500; const DEFAC=500;
const MINAC=100; const MINAC=100;
@ -80,7 +80,7 @@ $debug.='CONF: '.preprint($conf)."<br>\n";
$coopts=[ $coopts=[
'expires'=>$now+365*24*60*60, 'expires'=>$now+365*24*60*60,
'path'=>preg_replace('#[^/]+$#','',$_SERVER['REQUEST_URI']), 'path'=>preg_replace('#[^/]+$#','',$_SERVER['REQUEST_URI']),
'domain'=>$_SERVER['SERVER_NAME'], 'domain'=>$_SERVER['SERVER_NAME'],
'secure'=>false, 'secure'=>false,
'httponly'=>false, 'httponly'=>false,
@ -142,7 +142,7 @@ if (isset($_GET['code']) && isset($_COOKIE['verbose_host']) && isset($_COOKIE['v
header('Location: '.$location,true,302); header('Location: '.$location,true,302);
else else
echo "<a href=\"{$location}\">".htmlentities($location)."</a><br>\n"; echo "<a href=\"{$location}\">".htmlentities($location)."</a><br>\n";
exit(0); exit(0);
} else { } else {
$authmsgs.='<div class="error">Sorry, there was an error trying to authorize you: '.htmlentities($res['error'])."</div>\n"; $authmsgs.='<div class="error">Sorry, there was an error trying to authorize you: '.htmlentities($res['error'])."</div>\n";
} }
@ -174,7 +174,7 @@ if ($host!==false && $token!==false && trim($token)!='') {// trim($token)!='' is
setcookie('verbose_token',$token,$coopts); setcookie('verbose_token',$token,$coopts);
$myacc=$myacc['data']; $myacc=$myacc['data'];
$loggedin=true; $loggedin=true;
if ($_POST['round']==0 || $_POST['act']=='login') { if ($_POST['round']==0 || (isset($_POST['act']) && $_POST['act']=='login')) {
$res=mastget($host,$token,'/api/v1/instance',$timeout); $res=mastget($host,$token,'/api/v1/instance',$timeout);
if ($res['ok'] && isset($res['data']['configuration']['statuses']['max_characters']) && preg_match('#^\d+$#',$res['data']['configuration']['statuses']['max_characters'])===1) { if ($res['ok'] && isset($res['data']['configuration']['statuses']['max_characters']) && preg_match('#^\d+$#',$res['data']['configuration']['statuses']['max_characters'])===1) {
$avchars=$res['data']['configuration']['statuses']['max_characters']+0; $avchars=$res['data']['configuration']['statuses']['max_characters']+0;
@ -714,7 +714,7 @@ function ckf() {
if (i==len-1) sep='.'; if (i==len-1) sep='.';
msg+='<li>'+msgs[i]+sep+'</li>'; msg+='<li>'+msgs[i]+sep+'</li>';
} }
pmsg.innerHTML=msg+'</ul><p>&nbsp;</p><p class=\"firstp\">Do you want to continue?</p><p>&nbsp;</p><button class=\"halfbutton\" onclick=\"document.mainform.submit();\">Yes</button><button class=\"halfbutton\" onclick=\"swpdisp(\'popup\',\'flex\',\'none\');event.stopPropagation();\">No</button>'; pmsg.innerHTML=msg+'</ul><p>&nbsp;</p><p class=\"firstp\">Do you want to continue?</p><p>&nbsp;</p><button class=\"halfbutton\" onclick=\"document.mainform.submit(true);\">Yes</button><button class=\"halfbutton\" onclick=\"swpdisp(\'popup\',\'flex\',\'none\');event.stopPropagation();\">No</button>';
swpdisp('popup','none','flex'); swpdisp('popup','none','flex');
return false; return false;
} else { } else {