Compare commits
No commits in common. "97295fce6946f96148ca00f5c778cdf462f8b963" and "443887dc10210481643f2cacbeb0f7a213db6d14" have entirely different histories.
97295fce69
...
443887dc10
6 changed files with 2 additions and 52 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1,6 +1,2 @@
|
||||||
# host (replit)
|
|
||||||
*replit*
|
*replit*
|
||||||
.cache
|
|
||||||
|
|
||||||
# sts data to not git
|
|
||||||
data/index
|
data/index
|
6
PHP.ini
6
PHP.ini
|
@ -1,6 +0,0 @@
|
||||||
display_errors = "stderr"
|
|
||||||
display_startup_errors = true
|
|
||||||
html_errors = true
|
|
||||||
error_reporting = 'E_ALL'
|
|
||||||
zlib.output_compression = 1
|
|
||||||
zlib.output_compression_level = 9
|
|
|
@ -1,8 +0,0 @@
|
||||||
<?xml version='1.0' encoding='UTF-8'?>
|
|
||||||
<flags>
|
|
||||||
<any>
|
|
||||||
<sbox>
|
|
||||||
<input_type valid="text;search;" default="text">text</input_type>
|
|
||||||
</sbox>
|
|
||||||
</any>
|
|
||||||
</flags>
|
|
24
index.php
24
index.php
|
@ -1,14 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
libxml_use_internal_errors(true);
|
|
||||||
// load config
|
// load config
|
||||||
$cfg=parse_ini_file("serve.ini", true);
|
$cfg=parse_ini_file("serve.ini", true);
|
||||||
|
|
||||||
// load locale
|
// load locale
|
||||||
#$lang=locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
#$lang=locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
||||||
|
|
||||||
$lang="en_US";
|
$lang="en_US";
|
||||||
$strings=parse_ini_file("data/locale/".$lang."/strings/main.ini");
|
$strings=parse_ini_file("data/locale/".$lang."/strings/main.ini");
|
||||||
|
|
||||||
|
|
||||||
// cookies
|
// cookies
|
||||||
if(!isset($_COOKIE['sts_theme'])){
|
if(!isset($_COOKIE['sts_theme'])){
|
||||||
setcookie('sts_theme','default');
|
setcookie('sts_theme','default');
|
||||||
|
@ -18,22 +17,6 @@
|
||||||
setcookie('sts_scripting','none');
|
setcookie('sts_scripting','none');
|
||||||
$_COOKIE['sts_scripting'] = 'none';
|
$_COOKIE['sts_scripting'] = 'none';
|
||||||
}
|
}
|
||||||
if(!isset($_COOKIE['sts_flags'])){
|
|
||||||
setcookie('sts_flags',file_get_contents('data/xml/default.flags.xml'));
|
|
||||||
$_COOKIE['sts_flags'] = simplexml_load_file('data/xml/default.flags.xml') or die('failed loading an xml file!');
|
|
||||||
}else{
|
|
||||||
$_COOKIE['sts_flags'] = simplexml_load_string($_COOKIE['sts_flags']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($_COOKIE['sts_flags'] === false) {
|
|
||||||
http_response_code(500);
|
|
||||||
header('Content-Type: text/plain; charset=utf-8');
|
|
||||||
echo "An error occured within superTinySearch!\n\nWhat happened:\tfailed to parse cookie 'sts_flags'!\n\nAdditional info:\n";
|
|
||||||
foreach(libxml_get_errors() as $error) {
|
|
||||||
echo "\n\t", $error->message;
|
|
||||||
}
|
|
||||||
die(sprintf("\n\ncontact %s @ %s",$cfg['MAINTAINERS_0']['name'],$cfg['MAINTAINERS_0']['email']));
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
@ -50,14 +33,11 @@
|
||||||
?>
|
?>
|
||||||
<?php
|
<?php
|
||||||
echo "<div class=\"searchbox\"><form id=\"searchbox\">\n";
|
echo "<div class=\"searchbox\"><form id=\"searchbox\">\n";
|
||||||
echo "<input class=\"sbox\" type=\"".$_COOKIE['sts_flags']['index']['sbox_type']."\" placeholder=\"".$strings['interactions_searcharea_hint']."\" name=\"query\">";
|
echo "<input class=\"sbox\" type=\"text\" placeholder=\"".$strings['interactions_searcharea_hint']."\" name=\"query\">";
|
||||||
echo "<input type=\"submit\" value=\"".$strings['interactions_basic_search']."\">\n";
|
echo "<input type=\"submit\" value=\"".$strings['interactions_basic_search']."\">\n";
|
||||||
echo "</form></div>"
|
echo "</form></div>"
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<iframe style="position:absolute;bottom:30px;right:10px;" src="dynamicGen.php?content=aboutserver" width="376" height="276"></iframe>
|
<iframe style="position:absolute;bottom:30px;right:10px;" src="dynamicGen.php?content=aboutserver" width="376" height="276"></iframe>
|
||||||
<div class="footer">
|
|
||||||
<div class="footeri right">
|
|
||||||
<a
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -1,12 +0,0 @@
|
||||||
<?php
|
|
||||||
libxml_use_internal_errors(true);
|
|
||||||
function validateXML($xmlstr,$type): bool{
|
|
||||||
if($type=="flags"){
|
|
||||||
$_xml=simplexml_load_string($xmlstr);
|
|
||||||
if($_xml===false){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
Loading…
Add table
Add a link
Reference in a new issue