") !== false) && strpos(('' . $decth), '%') !== false) { //file_put_contents('xx.xx', $decth . ' ... ' . $txtis); return floor(((intval(str_replace('%','',('' . $decth))) * $his) / 100.0) + $zerois); } else { return mp($decth); } } function mp($ingh) { if (strpos(('' . $ingh), '%') === false) { return $ingh; } else { return (intval(str_replace('%','',('' . $ingh))) + 0.0001); } } function antimp($ingh) { return explode('.00', str_replace('.00','%.00',str_replace('.0001','%',('' . $ingh))))[0]; } function collectstuff($inthingis, $proshape) { global $crcolour, $gcx, $gcy, $gwidth, $gheight, $gopacity, $gfontsize, $gradius, $gradiusone, $gradiustwo, $gshape, $w, $h, $zero; if ($proshape != '') { $gshape=strtolower($proshape); } if ($gshape == 'text' || $proshape == '') { if ($proshape != '') { $crcolour="black"; } $gcx=-1; $gcy=-1; $gwidth=-1; $gheight=-1; $gopacity=-1.0; $gfontsize=-1; $gradius=-1; $gradiusone=-1; $gradiustwo=-1; } if ($inthingis == '') { return ''; } $decthings=explode('.', strtolower($inthingis)); if ($gshape == 'text') { $crcolour='black'; if (sizeof($decthings) >= 3 && strpos(strtolower($inthingis), 'px') !== false) { for ($ii=0; $ii 1) { $gfontsize=explode('p', $decthings[$ii])[0]; $inthingis=str_replace('' . $decthings[$ii] . '.','', str_replace('.' . $decthings[$ii] . '','', str_replace('.' . $decthings[$ii] . '.','.', strtolower($inthingis) ))); $decthings=explode('.', strtolower($inthingis)); } } } if (sizeof($decthings) < 2 || substr(str_replace('%','',$inthingis),-1,1) < '0' || substr(str_replace('%','',$inthingis),-1,1) > '9') { return $inthingis; } $crcol=''; while (substr($inthingis,-1,1) == '.' || substr($inthingis,-1,1) == '%' || (substr($inthingis,-1,1) >= '0' && substr($inthingis,-1,1) <= '9')) { $crcol=substr($inthingis,-1,1) . $crcol; $inthingis=substr($inthingis,0,(-1 + strlen($inthingis))); } //file_put_contents('x.x', $crcol . ' ... ' . substr($inthingis,-1,1)); $decthings=explode('.', strtolower($crcol)); if (sizeof($decthings) >= 2) { $gcx=mp($decthings[0]); $gcy=txtmp($decthings[1], $inthingis, $h, $zero); if (sizeof($decthings) > 2) { $gopacity='0.' . xmp($decthings[2]); if (sizeof($decthings) > 3) { $gfontsize=xmp($decthings[3]); } } } else { return $inthingis . $crcol; } return $inthingis; } else { $crcolour='pink'; if (strpos(strtolower($inthingis), 'px') !== false) { for ($ii=0; $ii 1) { $gfontsize=explode('p', $decthings[$ii])[0]; $inthingis=str_replace('' . $decthings[$ii] . '.','', str_replace('.' . $decthings[$ii] . '','', str_replace('.' . $decthings[$ii] . '.','.', strtolower($inthingis) ))); $decthings=explode('.', strtolower($inthingis)); } } } } if (substr($inthingis,0,1) < '0' || substr($inthingis,0,1) > '9') { $crcolour=explode('0',explode('1',explode('2',explode('3',explode('4',explode('5',explode('6',explode('7',explode('8',explode('9',$inthingis)[0])[0])[0])[0])[0])[0])[0])[0])[0])[0]; $inthingis=strtolower(str_replace($crcolour, '', $inthingis)); $decthings=explode('.', strtolower($inthingis)); } else if (substr(str_replace('%','',$inthingis),-1,1) < '0' || substr(str_replace('%','',$inthingis),-1,1) > '9') { $crcolour=''; while (substr($inthingis,-1,1) < '0' || substr($inthingis,-1,1) > '9') { $crcolour=substr($inthingis,-1,1) . $crcolour; $inthingis=substr($inthingis,0,(-1 + strlen($inthingis))); } $inthingis=strtolower(str_replace($crcolour, '', $inthingis)); $decthings=explode('.', strtolower($inthingis)); } if ($gshape == 'text') { if (sizeof($decthings) >= 2) { $gcx=mp($decthings[0]); $gcy=txtmp($decthings[1], $inthingis, $h, $zero); if (sizeof($decthings) > 2) { $gopacity='0.' . xmp($decthings[2]); if (sizeof($decthings) > 3) { $gfontsize=xmp($decthings[3]); } } } } else if ($gshape == 'circle') { if (sizeof($decthings) >= 2) { $gcx=mp($decthings[0]); $gcy=mp($decthings[1]); if (sizeof($decthings) > 2) { $gradius=mp($decthings[2]); if (sizeof($decthings) > 3) { $gopacity='0.' . xmp($decthings[3]); } } } else if (sizeof($decthings) == 1 && $decthings[0] != '') { $gradius=mp($decthings[0]); } } else if ($gshape == 'ellipse') { if (sizeof($decthings) >= 4) { $gcx=mp($decthings[0]); $gcy=mp($decthings[1]); $gradiusone=mp($decthings[2]); $gradiustwo=mp($decthings[3]); if (sizeof($decthings) > 4) { //file_put_contents('x.x','' . $decthings[4]); $gopacity='0.' . xmp($decthings[4]); //file_put_contents('xx.xx','' . xmp($decthings[4])); } } else if (sizeof($decthings) == 3) { $gradiusone=mp($decthings[0]); $gradiustwo=mp($decthings[1]); $gopacity='0.' . xmp($decthings[2]); } else if (sizeof($decthings) == 2) { $gradiusone=mp($decthings[0]); $gradiustwo=mp($decthings[1]); } else if (sizeof($decthings) == 1 && $decthings[0] != '') { $gradius=mp($decthings[0]); } } else if ($gshape == 'line') { if (sizeof($decthings) >= 4) { $gcx=mp($decthings[0]); $gcy=mp($decthings[1]); $gwidth=mp($decthings[2]); $gheight=mp($decthings[3]); if (sizeof($decthings) > 4) { $gopacity='0.' . xmp($decthings[4]); } } } else if (strpos($gshape, 'polyline') !== false) { if (sizeof($decthings) >= 4) { $gcx=mp($decthings[0]); $gcy=mp($decthings[1]); $gwidth=mp($decthings[2]); $gheight=mp($decthings[3]); //$gshape.=' ' . $decthings[0] . ',' . $decthings[1] . ' ' . $decthings[2] . ',' . $decthings[3]; for ($ij=0; $ij= 1.0) { $gopacity='0.' . xmp($decthings[-1 + sizeof($decthings)]); } } } else if (strpos($gshape, 'polygon') !== false) { if (sizeof($decthings) >= 4) { $gcx=mp($decthings[0]); $gcy=mp($decthings[1]); $gwidth=mp($decthings[2]); $gheight=mp($decthings[3]); //$gshape.=' ' . $decthings[0] . ',' . $decthings[1] . ' ' . $decthings[2] . ',' . $decthings[3]; for ($ij=0; $ij= 1.0) { $gopacity='0.' . xmp($decthings[-1 + sizeof($decthings)]); } } } else if ($gshape == 'rect') { if (sizeof($decthings) >= 4) { $gcx=mp($decthings[0]); $gcy=mp($decthings[1]); $gwidth=mp($decthings[2]); $gheight=mp($decthings[3]); if (sizeof($decthings) > 4) { $gopacity='0.' . xmp($decthings[4]); } } else if (sizeof($decthings) == 3) { $gwidth=mp($decthings[0]); $gheight=mp($decthings[1]); $gopacity='0.' . xmp($decthings[2]); } else if (sizeof($decthings) == 2) { $gwidth=mp($decthings[0]); $gheight=mp($decthings[1]); } else if (sizeof($decthings) == 1 && $decthings[0] != '') { $gopacity='0.' . xmp($decthings[0]); } } return $crcolour; } function retandclear($inthing) { global $crcolour, $gcx, $gcy, $gwidth, $gheight, $gopacity, $gfontsize, $gradius, $gradiusone, $gradiustwo, $gshape, $w, $h; $outthing=$inthing; if (strpos($inthing, '= 0 && strpos($inthing, ' rx="') !== false) { $outthing=str_replace(' rx="' . explode('"', explode(' rx="', $outthing)[1])[0], ' rx="' . antimp($gradiusone), $outthing); } if (strtolower($gshape) == 'ellipse' && $gradiustwo >= 0 && strpos($inthing, ' ry="') !== false) { $outthing=str_replace(' ry="' . explode('"', explode(' ry="', $outthing)[1])[0], ' ry="' . antimp($gradiustwo), $outthing); } if ($gcx >= 0 && strpos(str_replace(' cx="',' x="',$inthing), ' x="') !== false) { $outthing=str_replace('x="' . explode('"', explode('x="', $outthing)[1])[0], 'x="' . antimp($gcx), $outthing); } if ($gcy >= 0 && strpos(str_replace(' cy="',' y="',$inthing), ' y="') !== false) { $outthing=str_replace('y="' . explode('"', explode('y="', $outthing)[1])[0], 'y="' . antimp($gcy), $outthing); } if ($gwidth >= 0 && strpos($inthing, ' width="') !== false) { $outthing=str_replace('width="' . explode('"', explode('width="', $outthing)[1])[0], 'width="' . antimp($gwidth) . 'px', $outthing); } if ($gheight >= 0 && strpos($inthing, ' height="') !== false) { $outthing=str_replace('height="' . explode('"', explode('height="', $outthing)[1])[0], 'height="' . antimp($gwidth) . 'px', $outthing); } if ($gcx >= 0 && strpos($inthing, ' x1="') !== false) { $outthing=str_replace('x1="' . explode('"', explode('x1="', $outthing)[1])[0], 'x1="' . antimp($gcx), $outthing); } if ($gcy >= 0 && strpos($inthing, ' y1="') !== false) { $outthing=str_replace('y1="' . explode('"', explode('y1="', $outthing)[1])[0], 'y1="' . antimp($gcy), $outthing); } if ($gwidth >= 0 && strpos($inthing, ' x2="') !== false) { $outthing=str_replace('x2="' . explode('"', explode('x2="', $outthing)[1])[0], 'x2="' . antimp($gwidth), $outthing); } if ($gheight >= 0 && strpos($inthing, ' y2="') !== false) { $outthing=str_replace('y2="' . explode('"', explode('y2="', $outthing)[1])[0], 'y2="' . antimp($gwidth), $outthing); } if (strtolower($gshape) == 'circle' && $gradius >= 0 && strpos($inthing, ' r="') !== false) { $outthing=str_replace(' r="' . explode('"', explode(' r="', $outthing)[1])[0], ' r="' . antimp($gradius), $outthing); } if (strtolower($gshape) == 'text' && $gfontsize >= 0 && strpos($inthing, ' font-size="') !== false) { $outthing=str_replace(' font-size="' . explode('"', explode(' font-size="', $outthing)[1])[0], ' font-size="' . antimp($gfontsize) . 'px', $outthing); } else if (strtolower($gshape) == 'text' && $gfontsize >= 0 && strpos($inthing, ' font-size="') === false) { $outthing=str_replace('= 0 && strpos($inthing, ' fill-opacity="') !== false) { $outthing=str_replace(' fill-opacity="' . explode('"', explode(' fill-opacity="', $outthing)[1])[0], ' fill-opacity="' . antimp($gopacity), $outthing); } if (strpos($gshape, 'line') !== false && $gopacity >= 0 && strpos($inthing, ' stroke-opacity="') !== false) { $outthing=str_replace(' stroke-opacity="' . explode('"', explode(' stroke-opacity="', $outthing)[1])[0], ' stroke-opacity="' . antimp($gopacity), $outthing); } if (strpos($gshape, 'line') === false && $crcolour != '' && strpos($inthing, ' fill="') !== false && strpos($inthing, ' fill="' . $crcolour) === false) { $outthing=str_replace(' fill="' . explode('"', explode(' fill="', $outthing)[1])[0], ' fill="' . $crcolour, $outthing); } if (strpos($gshape, 'line') !== false && $crcolour != '' && strpos($inthing, ' stroke="') !== false && strpos($inthing, ' stroke="' . $crcolour) === false) { $outthing=str_replace(' stroke="' . explode('"', explode(' stroke="', $outthing)[1])[0], ' stroke="' . $crcolour, $outthing); } if (strpos($gshape, 'polyline ') !== false && $gshape != 'polyline' && strpos($inthing, ' points="') !== false) { $outthing=str_replace(' points="' . explode('"', explode(' points="', $outthing)[1])[0], ' points="' . str_replace('polyline ','',antimp($gshape)), $outthing); } if (strpos($gshape, 'polygon ') !== false && $gshape != 'polygon' && strpos($inthing, ' points="') !== false) { $outthing=str_replace(' points="' . explode('"', explode(' points="', $outthing)[1])[0], ' points="' . str_replace('polygon ','',antimp($gshape)), $outthing); } if ($gshape != 'text') { $crcolour="pink"; $gcx=-1; $gcy=-1; $gwidth=-1; $gheight=-1; $gopacity=-1.0; $gfontsize=-1; $gradius=-1; $gradiusone=-1; $gradiustwo=-1; $gshape=''; } return str_replace(' height="px', ' height="' . $h . 'px', str_replace(' width="px', ' width="' . $w . 'px', $outthing)); } function ingp($m) { // thanks to https://pretagteam.com/question/how-do-i-convert-unicode-special-characters-to-html-entities global $innards, $preinnards; if ($innards != '') { $entity = preg_replace_callback('/[\x{80}-\x{10FFFF}]/u', function ($m) { $char = current($m); $utf = iconv('UTF-8', 'UCS-4', $char); //return sprintf("&#x%s;", ltrim(strtoupper(bin2hex($utf)), "0")); return sprintf("&#x%s;", ltrim(strtoupper(bin2hex($utf)), "0")); }, $innards); //file_put_contents('xx.x',$entity); $preinnards=htmlentities($entity); //file_put_contents('x.x',$entity . ' ... ' . $preinnards); $innards=''; } } if (isset($_GET['width'])) { $w=str_replace('+',' ',urldecode($_GET['width'])); } else if (isset($_POST['width'])) { $w=str_replace('+',' ',urldecode($_POST['width'])); } if (isset($_GET['height'])) { $h=str_replace('+',' ',urldecode($_GET['height'])); if ($w != 0) { $vbox=' viewBox="0 0 ' . $w . ' ' . $h . '" '; $pw='100%'; $ph='100%'; } } else if (isset($_POST['height'])) { $h=str_replace('+',' ',urldecode($_POST['height'])); if ($w != 0) { $vbox=' viewBox="0 0 ' . $w . ' ' . $h . '" '; $pw='100%'; $ph='100%'; } } $lc=''; if (isset($_GET['image']) && $imgis != '') { list($width, $height) = getimagesize(explode('#',$imgis)[0]); if (isset($_GET['insvg'])) { if (strpos((',' . $restis . ','), ',noimage,') === false) { $lastcontent='')); //file_put_contents('xww.xww', $restis); if (strpos((',' . $restis . ','), ',circle') !== false) { if (strpos((',' . $restis . ','), ',circle,') === false) { $crcolour=collectstuff(explode(',', explode(',circle', $restis)[1])[0], 'circle'); $restis=str_replace('circle' . $crcolour . ',','',str_replace(',circle' . $crcolour . ',','',$restis)); } $restis=str_replace('circle,','',str_replace(',circle,','',$restis)); $lc.="\n" . retandclear(''); //file_put_contents('xw.xw', $lastcontent); //exit; } if (strpos((',' . $restis . ','), ',line') !== false) { if (strpos((',' . $restis . ','), ',line,') === false) { $crcolour=collectstuff(explode(',', explode(',line', $restis)[1])[0], 'line'); $restis=str_replace('line' . $crcolour . ',','',str_replace(',line' . $crcolour . ',','',$restis)); } $restis=str_replace('line,','',str_replace(',line,','',$restis)); $lc.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',polyline') !== false) { if (strpos((',' . $restis . ','), ',polyline,') === false) { $crcolour=collectstuff(explode(',', explode(',polyline', $restis)[1])[0], 'polyline'); $restis=str_replace('polyline' . $crcolour . ',','',str_replace(',polyline' . $crcolour . ',','',$restis)); } $restis=str_replace('polyline,','',str_replace(',polyline,','',$restis)); $lc.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',polygon') !== false) { if (strpos((',' . $restis . ','), ',polygon,') === false) { $crcolour=collectstuff(explode(',', explode(',polygon', $restis)[1])[0], 'polygon'); $restis=str_replace('polygon' . $crcolour . ',','',str_replace(',polygon' . $crcolour . ',','',$restis)); } $restis=str_replace('polygon,','',str_replace(',polygon,','',$restis)); $lc.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',ellipse') !== false) { if (strpos((',' . $restis . ','), ',ellipse,') === false) { $crcolour=collectstuff(explode(',', explode(',ellipse', $restis)[1])[0], 'ellipse'); $restis=str_replace('ellipse' . $crcolour . ',','',str_replace(',ellipse' . $crcolour . ',','',$restis)); } $restis=str_replace('ellipse,','',str_replace(',ellipse,','',$restis)); $lc.="\n" . retandclear(''); //file_put_contents('xw.xw', $lastcontent); //exit; } if (strpos((',' . $restis . ','), ',rect') !== false) { if (strpos((',' . $restis . ','), ',rect,') === false) { $crcolour=collectstuff(explode(',', explode(',rect', $restis)[1])[0], 'rect'); $restis=str_replace('rect' . $crcolour . ',','',str_replace(',rect' . $crcolour . ',','',$restis)); } $restis=str_replace('rect,','',str_replace(',rect,','',$restis)); $lc.="\n" . retandclear(''); } } else { //$restis=str_replace('noimage,','',str_replace(',noimage,','',$restis)); if (strpos((',' . $restis . ','), ',circle') !== false) { if (strpos((',' . $restis . ','), ',circle,') === false) { $crcolour=collectstuff(explode(',', explode(',circle', $restis)[1])[0], 'circle'); $restis=str_replace('circle' . $crcolour . ',','',str_replace(',circle' . $crcolour . ',','',$restis)); } $restis=str_replace('circle,','',str_replace(',circle,','',$restis)); $lc.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',line') !== false) { if (strpos((',' . $restis . ','), ',line,') === false) { $crcolour=collectstuff(explode(',', explode(',line', $restis)[1])[0], 'line'); $restis=str_replace('line' . $crcolour . ',','',str_replace(',line' . $crcolour . ',','',$restis)); } $restis=str_replace('line,','',str_replace(',line,','',$restis)); $lc.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',polyline') !== false) { if (strpos((',' . $restis . ','), ',polyline,') === false) { $crcolour=collectstuff(explode(',', explode(',polyline', $restis)[1])[0], 'polyline'); $restis=str_replace('polyline' . $crcolour . ',','',str_replace(',polyline' . $crcolour . ',','',$restis)); } $restis=str_replace('polyline,','',str_replace(',polyline,','',$restis)); $lc.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',polygon') !== false) { if (strpos((',' . $restis . ','), ',polygon,') === false) { $crcolour=collectstuff(explode(',', explode(',polygon', $restis)[1])[0], 'polygon'); $restis=str_replace('polygon' . $crcolour . ',','',str_replace(',polygon' . $crcolour . ',','',$restis)); } $restis=str_replace('polygon,','',str_replace(',polygon,','',$restis)); $lc.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',ellipse') !== false) { if (strpos((',' . $restis . ','), ',ellipse,') === false) { $crcolour=collectstuff(explode(',', explode(',ellipse', $restis)[1])[0], 'ellipse'); $restis=str_replace('ellipse' . $crcolour . ',','',str_replace(',ellipse' . $crcolour . ',','',$restis)); } $restis=str_replace('ellipse,','',str_replace(',ellipse,','',$restis)); $lc.="\n" . retandclear(''); //file_put_contents('xw.xw', $lastcontent); //exit; } if (strpos((',' . $restis . ','), ',rect') !== false) { if (strpos((',' . $restis . ','), ',rect,') === false) { $crcolour=collectstuff(explode(',', explode(',rect', $restis)[1])[0], 'rect'); $restis=str_replace('rect' . $crcolour . ',','',str_replace(',rect' . $crcolour . ',','',$restis)); } $restis=str_replace('rect,','',str_replace(',rect,','',$restis)); $lc.="\n" . retandclear(''); } } } else { if (strpos((',' . $restis . ','), ',noimage,') === false) { $lastcontent='')); if (strpos((',' . $restis . ','), ',circle') !== false) { if (strpos((',' . $restis . ','), ',circle,') === false) { $crcolour=collectstuff(explode(',', explode(',circle', $restis)[1])[0], 'circle'); $restis=str_replace('circle' . $crcolour . ',','',str_replace(',circle' . $crcolour . ',','',$restis)); } $restis=str_replace('circle,','',str_replace(',circle,','',$restis)); $lc.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',line') !== false) { if (strpos((',' . $restis . ','), ',line,') === false) { $crcolour=collectstuff(explode(',', explode(',line', $restis)[1])[0], 'line'); $restis=str_replace('line' . $crcolour . ',','',str_replace(',line' . $crcolour . ',','',$restis)); } $restis=str_replace('line,','',str_replace(',line,','',$restis)); $lc.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',polyline') !== false) { if (strpos((',' . $restis . ','), ',polyline,') === false) { $crcolour=collectstuff(explode(',', explode(',polyline', $restis)[1])[0], 'polyline'); $restis=str_replace('polyline' . $crcolour . ',','',str_replace(',polyline' . $crcolour . ',','',$restis)); } $restis=str_replace('polyline,','',str_replace(',polyline,','',$restis)); $lc.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',polygon') !== false) { if (strpos((',' . $restis . ','), ',polygon,') === false) { $crcolour=collectstuff(explode(',', explode(',polygon', $restis)[1])[0], 'polygon'); $restis=str_replace('polygon' . $crcolour . ',','',str_replace(',polygon' . $crcolour . ',','',$restis)); } $restis=str_replace('polygon,','',str_replace(',polygon,','',$restis)); $lc.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',ellipse') !== false) { if (strpos((',' . $restis . ','), ',ellipse,') === false) { $crcolour=collectstuff(explode(',', explode(',ellipse', $restis)[1])[0], 'ellipse'); $restis=str_replace('ellipse' . $crcolour . ',','',str_replace(',ellipse' . $crcolour . ',','',$restis)); } $restis=str_replace('ellipse,','',str_replace(',ellipse,','',$restis)); $lc.="\n" . retandclear(''); //file_put_contents('xw.xw', $lastcontent); //exit; } if (strpos((',' . $restis . ','), ',rect') !== false) { if (strpos((',' . $restis . ','), ',rect,') === false) { $crcolour=collectstuff(explode(',', explode(',rect', $restis)[1])[0], 'rect'); $restis=str_replace('rect' . $crcolour . ',','',str_replace(',rect' . $crcolour . ',','',$restis)); } $restis=str_replace('rect,','',str_replace(',rect,','',$restis)); $lc.="\n" . retandclear(''); } } else { //$restis=str_replace('noimage,','',str_replace(',noimage,','',$restis)); if (strpos((',' . $restis . ','), ',circle') !== false) { if (strpos((',' . $restis . ','), ',circle,') === false) { $crcolour=collectstuff(explode(',', explode(',circle', $restis)[1])[0], 'circle'); $restis=str_replace('circle' . $crcolour . ',','',str_replace(',circle' . $crcolour . ',','',$restis)); } $restis=str_replace('circle,','',str_replace(',circle,','',$restis)); $lc.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',line') !== false) { if (strpos((',' . $restis . ','), ',line,') === false) { $crcolour=collectstuff(explode(',', explode(',line', $restis)[1])[0], 'line'); $restis=str_replace('line' . $crcolour . ',','',str_replace(',line' . $crcolour . ',','',$restis)); } $restis=str_replace('line,','',str_replace(',line,','',$restis)); $lc.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',polyline') !== false) { if (strpos((',' . $restis . ','), ',polyline,') === false) { $crcolour=collectstuff(explode(',', explode(',polyline', $restis)[1])[0], 'polyline'); $restis=str_replace('polyline' . $crcolour . ',','',str_replace(',polyline' . $crcolour . ',','',$restis)); } $restis=str_replace('polyline,','',str_replace(',polyline,','',$restis)); $lc.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',polygon') !== false) { if (strpos((',' . $restis . ','), ',polygon,') === false) { $crcolour=collectstuff(explode(',', explode(',polygon', $restis)[1])[0], 'polygon'); $restis=str_replace('polygon' . $crcolour . ',','',str_replace(',polygon' . $crcolour . ',','',$restis)); } $restis=str_replace('polygon,','',str_replace(',polygon,','',$restis)); $lc.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',ellipse') !== false) { if (strpos((',' . $restis . ','), ',ellipse,') === false) { $crcolour=collectstuff(explode(',', explode(',ellipse', $restis)[1])[0], 'ellipse'); $restis=str_replace('ellipse' . $crcolour . ',','',str_replace(',ellipse' . $crcolour . ',','',$restis)); } $restis=str_replace('ellipse,','',str_replace(',ellipse,','',$restis)); $lc.="\n" . retandclear(''); //file_put_contents('xw.xw', $lastcontent); //exit; } if (strpos((',' . $restis . ','), ',rect') !== false) { if (strpos((',' . $restis . ','), ',rect,') === false) { $crcolour=collectstuff(explode(',', explode(',rect', $restis)[1])[0], 'rect'); $restis=str_replace('rect' . $crcolour . ',','',str_replace(',rect' . $crcolour . ',','',$restis)); } $restis=str_replace('rect,','',str_replace(',rect,','',$restis)); $lc.="\n" . retandclear(''); } } } if ($h == 0) { $h=$height; $ph=(40 + $zz + $h); } if ($w == 0) { $w=$width; $pw=(40 + $zz + $w); } if (isset($_GET['insvg'])) { if (strpos((',' . $restis . ','), ',noimage,') === false) { $lastcontent='')) . $lc; } else { $lastcontent.=$lc; } $w+=40; //$w=(($w + 20) / 20) * 20; $h+=40; //$h=(($h + 20) / 20) * 20; if ($vbox != '') { $vbox=' viewBox="0 0 ' . $w . ' ' . $h . '" '; $pw=(40 + $zz + $w); $ph=(40 + $zz + $h); } } } else if (isset($_POST['image']) && $imgis != '') { list($width, $height) = getimagesize(explode('#',$imgis)[0]); if (isset($_POST['insvg'])) { if (strpos((',' . $restis . ','), ',noimage,') === false) { $lastcontent='')); if (strpos((',' . $restis . ','), ',circle,') !== false) { $restis=str_replace('circle,','',str_replace(',circle,','',$restis)); $lc.=retandclear(''); } if (strpos((',' . $restis . ','), ',line') !== false) { if (strpos((',' . $restis . ','), ',line,') === false) { $crcolour=collectstuff(explode(',', explode(',line', $restis)[1])[0], 'line'); $restis=str_replace('line' . $crcolour . ',','',str_replace(',line' . $crcolour . ',','',$restis)); } $restis=str_replace('line,','',str_replace(',line,','',$restis)); $lc.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',polyline') !== false) { if (strpos((',' . $restis . ','), ',polyline,') === false) { $crcolour=collectstuff(explode(',', explode(',polyline', $restis)[1])[0], 'polyline'); $restis=str_replace('polyline' . $crcolour . ',','',str_replace(',polyline' . $crcolour . ',','',$restis)); } $restis=str_replace('polyline,','',str_replace(',polyline,','',$restis)); $lc.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',polygon') !== false) { if (strpos((',' . $restis . ','), ',polygon,') === false) { $crcolour=collectstuff(explode(',', explode(',polygon', $restis)[1])[0], 'polygon'); $restis=str_replace('polygon' . $crcolour . ',','',str_replace(',polygon' . $crcolour . ',','',$restis)); } $restis=str_replace('polygon,','',str_replace(',polygon,','',$restis)); $lc.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',ellipse') !== false) { $restis=str_replace('ellipse,','',str_replace(',ellipse,','',$restis)); $lc.=retandclear(''); } if (strpos((',' . $restis . ','), ',rect,') !== false) { $restis=str_replace('rect,','',str_replace(',rect,','',$restis)); $lc.=retandclear(''); } } else { //$restis=str_replace('noimage,','',str_replace(',noimage,','',$restis)); if (strpos((',' . $restis . ','), ',circle,') !== false) { $restis=str_replace('circle,','',str_replace(',circle,','',$restis)); $lc.=retandclear(''); } if (strpos((',' . $restis . ','), ',line') !== false) { if (strpos((',' . $restis . ','), ',line,') === false) { $crcolour=collectstuff(explode(',', explode(',line', $restis)[1])[0], 'line'); $restis=str_replace('line' . $crcolour . ',','',str_replace(',line' . $crcolour . ',','',$restis)); } $restis=str_replace('line,','',str_replace(',line,','',$restis)); $lc.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',polyline') !== false) { if (strpos((',' . $restis . ','), ',polyline,') === false) { $crcolour=collectstuff(explode(',', explode(',polyline', $restis)[1])[0], 'polyline'); $restis=str_replace('polyline' . $crcolour . ',','',str_replace(',polyline' . $crcolour . ',','',$restis)); } $restis=str_replace('polyline,','',str_replace(',polyline,','',$restis)); $lc.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',polygon') !== false) { if (strpos((',' . $restis . ','), ',polygon,') === false) { $crcolour=collectstuff(explode(',', explode(',polygon', $restis)[1])[0], 'polygon'); $restis=str_replace('polygon' . $crcolour . ',','',str_replace(',polygon' . $crcolour . ',','',$restis)); } $restis=str_replace('polygon,','',str_replace(',polygon,','',$restis)); $lc.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',ellipse') !== false) { $restis=str_replace('ellipse,','',str_replace(',ellipse,','',$restis)); $lc.=retandclear(''); } if (strpos((',' . $restis . ','), ',rect,') !== false) { $restis=str_replace('rect,','',str_replace(',rect,','',$restis)); $lc.=retandclear(''); } } } else { if (strpos((',' . $restis . ','), ',noimage,') === false) { $lastcontent='')); if (strpos((',' . $restis . ','), ',circle,') !== false) { $restis=str_replace('circle,','',str_replace(',circle,','',$restis)); $lc.=retandclear(''); } if (strpos((',' . $restis . ','), ',line') !== false) { if (strpos((',' . $restis . ','), ',line,') === false) { $crcolour=collectstuff(explode(',', explode(',line', $restis)[1])[0], 'line'); $restis=str_replace('line' . $crcolour . ',','',str_replace(',line' . $crcolour . ',','',$restis)); } $restis=str_replace('line,','',str_replace(',line,','',$restis)); $lc.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',polyline') !== false) { if (strpos((',' . $restis . ','), ',polyline,') === false) { $crcolour=collectstuff(explode(',', explode(',polyline', $restis)[1])[0], 'polyline'); $restis=str_replace('polyline' . $crcolour . ',','',str_replace(',polyline' . $crcolour . ',','',$restis)); } $restis=str_replace('polyline,','',str_replace(',polyline,','',$restis)); $lc.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',polygon') !== false) { if (strpos((',' . $restis . ','), ',polygon,') === false) { $crcolour=collectstuff(explode(',', explode(',polygon', $restis)[1])[0], 'polygon'); $restis=str_replace('polygon' . $crcolour . ',','',str_replace(',polygon' . $crcolour . ',','',$restis)); } $restis=str_replace('polygon,','',str_replace(',polygon,','',$restis)); $lc.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',ellipse') !== false) { $restis=str_replace('ellipse,','',str_replace(',ellipse,','',$restis)); $lc.=retandclear(''); } if (strpos((',' . $restis . ','), ',rect,') !== false) { $restis=str_replace('rect,','',str_replace(',rect,','',$restis)); $lc.=retandclear(''); } } else { //$restis=str_replace('noimage,','',str_replace(',noimage,','',$restis)); if (strpos((',' . $restis . ','), ',circle,') !== false) { $restis=str_replace('circle,','',str_replace(',circle,','',$restis)); $lc.=retandclear(''); } if (strpos((',' . $restis . ','), ',line') !== false) { if (strpos((',' . $restis . ','), ',line,') === false) { $crcolour=collectstuff(explode(',', explode(',line', $restis)[1])[0], 'line'); $restis=str_replace('line' . $crcolour . ',','',str_replace(',line' . $crcolour . ',','',$restis)); } $restis=str_replace('line,','',str_replace(',line,','',$restis)); $lc.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',polyline') !== false) { if (strpos((',' . $restis . ','), ',polyline,') === false) { $crcolour=collectstuff(explode(',', explode(',polyline', $restis)[1])[0], 'polyline'); $restis=str_replace('polyline' . $crcolour . ',','',str_replace(',polyline' . $crcolour . ',','',$restis)); } $restis=str_replace('polyline,','',str_replace(',polyline,','',$restis)); $lc.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',polygon') !== false) { if (strpos((',' . $restis . ','), ',polygon,') === false) { $crcolour=collectstuff(explode(',', explode(',polygon', $restis)[1])[0], 'polygon'); $restis=str_replace('polygon' . $crcolour . ',','',str_replace(',polygon' . $crcolour . ',','',$restis)); } $restis=str_replace('polygon,','',str_replace(',polygon,','',$restis)); $lc.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',ellipse') !== false) { $restis=str_replace('ellipse,','',str_replace(',ellipse,','',$restis)); $lc.=retandclear(''); } if (strpos((',' . $restis . ','), ',rect,') !== false) { $restis=str_replace('rect,','',str_replace(',rect,','',$restis)); $lc.=retandclear(''); } } } if ($h == 0) { $h=$height; $ph=(40 + $zz + $h); } if ($w == 0) { $w=$width; $pw=(40 + $zz + $w); } if (isset($_POST['insvg'])) { if (strpos((',' . $restis . ','), ',noimage,') === false) { $lastcontent='')) . $lc; } else { $lastcontent.=$lc; } $w+=40; //$w=(($w + 20) / 20) * 20; $h+=40; //$h=(($h + 20) / 20) * 20; if ($vbox != '') { $vbox=' viewBox="0 0 ' . $w . ' ' . $h . '" '; $pw=(40 + $zz + $w); $ph=(40 + $zz + $h); } } } if ($pw == '' && $h != 0) { $pw=(40 + $zz + $w); } if ($ph == '' && $h != 0) { $ph=(40 + $zz + $h); } foreach ($_GET as $name=>$val) { if (strpos(strtolower('' . $name . '~'), 'css~') !== false) { if ($svgmiddle == '') { $svgmiddle=" "; } else { $svgmiddle=str_replace("",str_replace(' ',' ',str_replace('+', ' ', urldecode($_GET[$tn])))), 'text'); if ($gminus30 >= 0) { $minus30=$gminus30; } else { $minus30=($w / $wtwo) - strlen(explode('
', $txt)[0]) * $threedotone; } if ($gtop30 >= 0) { $top30=$h - 10 - (sizeof(explode('
', $txt)) * 15); $gtop30=-1; } else { $top30=($h / $htwo) + $twentyfive - (sizeof(explode('
', $txt)) * $eight); } $lines=explode('
', $txt); if ($gcx >= 0 && $gcy >= 0) { $minus30=str_replace('.0001','%',('' . $gcx)); $top30=str_replace('.0001','%',('' . $gcy)); $gcx=-1; $gcy=-1; } for ($il=0; $il' . $lines[$il] . '
'); $top30+=15; } } $gminus30=-1; $gtop30=-1; $eight=8; $twentyfive=25; $threedotone=3.1; $textjust=""; $wtwo=2.0; $htwo=2.0; $tn=''; } } foreach ($_POST as $name=>$val) { if (strpos(strtolower('' . $name . '~'), 'css~') !== false) { if ($svgmiddle == '') { $svgmiddle=" "; } else { $svgmiddle=str_replace("",str_replace(' ',' ',str_replace('+', ' ', urldecode($_POST[$tn])))), 'text'); if ($gminus30 >= 0) { $minus30=$gminus30; } else { $minus30=($w / $wtwo) - strlen(explode('
', $txt)[0]) * $threedotone; } if ($gtop30 >= 0) { $top30=$h - 10 - (sizeof(explode('
', $txt)) * 15); $gtop30=-1; } else { $top30=($h / $htwo) + $twentyfive - (sizeof(explode('
', $txt)) * $eight); } $lines=explode('
', $txt); if ($gcx >= 0 && $gcy >= 0) { $minus30=str_replace('.0001','%',('' . $gcx)); $top30=str_replace('.0001','%',('' . $gcy)); $gcx=-1; $gcy=-1; } for ($il=0; $il' . $lines[$il] . '
'); $top30+=15; } } $gminus30=-1; $gtop30=-1; $eight=8; $twentyfive=25; $threedotone=3.1; $textjust=""; $wtwo=2.0; $htwo=2.0; $tn=''; } } if ($tn != '') { if (isset($_GET[$tn])) { $txt=collectstuff(sstr_replace("\n","
",str_replace(' ',' ',str_replace('+', ' ', urldecode($_GET[$tn])))), 'text'); if ($gminus30 >= 0) { $minus30=$gminus30; } else { $minus30=($w / $wtwo) - strlen(explode('
', $txt)[0]) * $threedotone; } if ($gtop30 >= 0) { $top30=$h - (sizeof(explode('
', $txt)) * 15); $gtop30=-1; } else { $top30=($h / $htwo) + $twentyfive - (sizeof(explode('
', $txt)) * $eight); } $lines=explode('
', $txt); if ($gcx >= 0 && $gcy >= 0) { $minus30=str_replace('.0001','%',('' . $gcx)); $top30=str_replace('.0001','%',('' . $gcy)); $gcx=-1; $gcy=-1; } for ($il=0; $il' . $lines[$il] . ''); $top30+=15; } } else if (isset($_POST[$tn])) { $txt=collectstuff(sstr_replace("\n","
",str_replace(' ',' ',str_replace('+', ' ', urldecode($_POST[$tn])))), 'text'); if ($gminus30 >= 0) { $minus30=$gminus30; } else { $minus30=($w / $wtwo) - strlen(explode('
', $txt)[0]) * $threedotone; } if ($gtop30 >= 0) { $top30=$h - (sizeof(explode('
', $txt)) * 15); $gtop30=-1; } else { $top30=($h / $htwo) + $twentyfive - (sizeof(explode('
', $txt)) * $eight); } $lines=explode('
', $txt); if ($gcx >= 0 && $gcy >= 0) { $minus30=str_replace('.0001','%',('' . $gcx)); $top30=str_replace('.0001','%',('' . $gcy)); $gcx=-1; $gcy=-1; } for ($il=0; $il' . $lines[$il] . ''); $top30+=15; } } } if (isset($_GET['insvg'])) { $innards=str_replace('+','',urldecode($_GET['insvg'])); if (trim(str_replace(',','',str_replace('0','',str_replace('1','',str_replace('2','',str_replace('3','',str_replace('4','',str_replace('5','',str_replace('6','',str_replace('7','',str_replace('8','',str_replace('9','',$innards)))))))))))) != '') { ingp($innards); } if ($preinnards == '') { $preinnards='&#' . str_replace(',',';&#',$innards) . ';'; } $svgprefix=''; $svgsuffix=''; if (strpos($innards, ''; } else { $svgprefix=''; } $svgsuffix=''; if (trim(str_replace(',','',str_replace('0','',str_replace('1','',str_replace('2','',str_replace('3','',str_replace('4','',str_replace('5','',str_replace('6','',str_replace('7','',str_replace('8','',str_replace('9','',$innards)))))))))))) == '') { for ($x=0; $x<=$w; $x+=20) { for ($y=0; $y<=(0 + $h); $y+=20) { if ($x == 0 && $y == 0) { $innards='' . $preinnards . ''; if ($h > 0) { $innardslast.='' . $preinnards . ''; } } else if (isset($_GET['background']) || isset($_GET[$whati]) || $x == 0 || $y == 0 || ($x + 20) > $w || ($y + 20) > (0 + $h)) { if ($x == $w) { $innardslast.='' . $preinnards . ''; } else if ($y >= $h) { $innardslast.='' . $preinnards . ''; } else { $innards.='' . $preinnards . ''; } if ($x == 0) { $innardslast.='' . $preinnards . ''; } else if ($y == 0) { $innardslast.='' . $preinnards . ''; } else { $innards.='' . $preinnards . ''; } } } } } } ourecho ('' . html_entity_decode('' . $svgprefix . $svgmiddle . $innards . $innardslast . $lastcontent . $textcontent . $svgsuffix, ENT_QUOTES, "utf-8")); } else if (isset($_POST['insvg'])) { $innards=str_replace('+','',urldecode($_POST['insvg'])); if (trim(str_replace(',','',str_replace('0','',str_replace('1','',str_replace('2','',str_replace('3','',str_replace('4','',str_replace('5','',str_replace('6','',str_replace('7','',str_replace('8','',str_replace('9','',$innards)))))))))))) != '') { ingp($innards); } if ($preinnards == '') { $preinnards='&#' . str_replace(',',';&#',$innards) . ';'; } $svgprefix=''; $svgsuffix=''; if (strpos($innards, ''; } else { $svgprefix=''; } $svgsuffix=''; if (trim(str_replace(',','',str_replace('0','',str_replace('1','',str_replace('2','',str_replace('3','',str_replace('4','',str_replace('5','',str_replace('6','',str_replace('7','',str_replace('8','',str_replace('9','',$innards)))))))))))) == '') { for ($x=0; $x<=$w; $x+=20) { for ($y=0; $y<=(0 + $h); $y+=20) { if ($x == 0 && $y == 0) { $innards='' . $preinnards . ''; if ($h > 0) { $innardslast.='' . $preinnards . ''; } } else if (isset($_GET['background']) || isset($_GET[$whati]) || $x == 0 || $y == 0 || ($x + 20) > $w || ($y + 20) > (0 + $h)) { if ($x == $w) { $innardslast.='' . $preinnards . ''; } else if ($y >= $h) { $innardslast.='' . $preinnards . ''; } else { $innards.='' . $preinnards . ''; } if ($x == 0) { $innardslast.='' . $preinnards . ''; } else if ($y == 0) { $innardslast.='' . $preinnards . ''; } else { $innards.='' . $preinnards . ''; } } } } } } ourecho ('' . html_entity_decode('' . $svgprefix . $svgmiddle . $innards . $innardslast . $lastcontent . $textcontent . $svgsuffix, ENT_QUOTES, "utf-8")); } else if (isset($_POST['image']) || isset($_GET['image'])) { ourecho ('' . html_entity_decode('' . $svgmiddle . $lastcontent . $textcontent . '', ENT_QUOTES, "utf-8")); } else { ourecho ('' . html_entity_decode('' . $svgmiddle . '', ENT_QUOTES, "utf-8")); } function ourecho($inh) { global $asbkg, $lastcontent, $restis, $h, $w, $pw, $ph, $crcolor, $crfillop, $zero, $lc, $textcontent; $lcextra=''; if ($restis != '') { if (strpos((',' . $restis . ','), ',circle') !== false) { if (strpos((',' . $restis . ','), ',circle,') === false) { $crcolour=collectstuff(explode(',', explode(',circle', $restis)[1])[0], 'circle'); $restis=str_replace('circle' . $crcolour . ',','',str_replace(',circle' . $crcolour . ',','',$restis)); } $restis=str_replace('circle,','',str_replace(',circle,','',$restis)); $lcextra.=retandclear(''); } if (strpos((',' . $restis . ','), ',line') !== false) { if (strpos((',' . $restis . ','), ',line,') === false) { $crcolour=collectstuff(explode(',', explode(',line', $restis)[1])[0], 'line'); $restis=str_replace('line' . $crcolour . ',','',str_replace(',line' . $crcolour . ',','',$restis)); } $restis=str_replace('line,','',str_replace(',line,','',$restis)); $lcextra.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',polyline') !== false) { if (strpos((',' . $restis . ','), ',polyline,') === false) { $crcolour=collectstuff(explode(',', explode(',polyline', $restis)[1])[0], 'polyline'); $restis=str_replace('polyline' . $crcolour . ',','',str_replace(',polyline' . $crcolour . ',','',$restis)); } $restis=str_replace('polyline,','',str_replace(',polyline,','',$restis)); $lcextra.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',polygon') !== false) { if (strpos((',' . $restis . ','), ',polygon,') === false) { $crcolour=collectstuff(explode(',', explode(',polygon', $restis)[1])[0], 'polygon'); $restis=str_replace('polygon' . $crcolour . ',','',str_replace(',polygon' . $crcolour . ',','',$restis)); } $restis=str_replace('polygon,','',str_replace(',polygon,','',$restis)); $lcextra.="\n" . retandclear(''); } if (strpos((',' . $restis . ','), ',ellipse') !== false) { if (strpos((',' . $restis . ','), ',ellipse,') === false) { $crcolour=collectstuff(explode(',', explode(',ellipse', $restis)[1])[0], 'ellipse'); $restis=str_replace('ellipse' . $crcolour . ',','',str_replace(',ellipse' . $crcolour . ',','',$restis)); } $restis=str_replace('ellipse,','',str_replace(',ellipse,','',$restis)); $lcextra.=retandclear(''); } if (strpos((',' . $restis . ','), ',rect') !== false) { if (strpos((',' . $restis . ','), ',rect,') === false) { $crcolour=collectstuff(explode(',', explode(',rect', $restis)[1])[0], 'rect'); $restis=str_replace('rect' . $crcolour . ',','',str_replace(',rect' . $crcolour . ',','',$restis)); } $restis=str_replace('rect,','',str_replace(',rect,','',$restis)); $lcextra.=retandclear(''); } if ($lcextra == '' && $lc != '') { $lcextra=$lc; // . $textcontent; if ($textcontent != '') { $lcextra.=$textcontent; } } if ($textcontent != '') { if (strpos($inh, $textcontent) === false) { $lcextra.=$textcontent; } } if ($lcextra != '') { if (strpos($inh, '') !== false) { $inh=str_replace('', $lcextra . '', $inh); } else { $inh.=$lcextra; } } } if ($asbkg && (isset($_GET['midbit']) || isset($_POST['midbit']))) { echo '', $inh)[0])[1] . ''; //'"; } else if ($asbkg) { if (isset($_GET['nobase64']) || isset($_POST['nobase64'])) { echo "data:image/svg+xml;utf8," . ('', $inh)[0])[1] . ''); } else { echo "data:image/svg+xml;base64," . base64_encode('', $inh)[0])[1] . ''); } } else { echo $inh; } } ?>