Skip to content

Commit

Permalink
v1.1.10 Release
Browse files Browse the repository at this point in the history
v1.1.10 Release
  • Loading branch information
Axton authored Jun 24, 2022
2 parents 036fe6a + 4dfdb6c commit c226cbd
Show file tree
Hide file tree
Showing 16 changed files with 213 additions and 146 deletions.
2 changes: 1 addition & 1 deletion .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ErrorDocument 403 /403
ErrorDocument 500 /500

# File security
<FilesMatch "\.(json|sarif|md|gitignore|version|LICENSE|htaccess|env)$">
<FilesMatch "\.(json|sarif|gitignore|version|htaccess|env|security-scan|config|cache)$">
Order allow,deny
Deny from all
</FilesMatch>
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "BRANCH": "main", "VERSION":"1.1.9" }
{ "BRANCH": "main", "VERSION":"1.1.10" }
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Axtonprice, QuickBlaze
Copyright (c) 2022 axtonprice, QuickBlaze

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
186 changes: 109 additions & 77 deletions Modules/Functions.php → Modules/functions.php

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions Public/assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,4 @@ textarea {
bottom: 0;
opacity: 0;
}
}

#subheading_moto {
opacity: 0;
transition: opacity 1000ms;
}

#subheading_moto.show {
opacity: 1;
}
19 changes: 8 additions & 11 deletions Public/assets/js/buttonCopyURL.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
function copyToClipboard(element) {
var $temp = $("<input>");
$("body").append($temp);
let $temp = $('<input>');
$('body').append($temp);
$temp.val($(element).text()).select();
document.execCommand("copy");
document.execCommand('copy');
showSnackBar('snackbar'); // show snackbar notification
log(`Copied text to clipboard`);
$temp.remove();
showSnackBar('snackbar'); // show snackbar notification
}

function showSnackBar(snackbarId) {
var x = document.getElementById(snackbarId);
x.className = "show";
var time = 3000;
log(`Displaying snackbar for ${time}ms`);
setTimeout(function () {
x.className = x.className.replace("show", "");
}, time);
var element = document.getElementById(`${snackbarId}`);
element.className = element.className.replace('', 'show');
log(`Displaying snackbar for ${3000}ms`);
setTimeout(function () { element.className = element.className.replace("show", ""); }, 3000);
}
59 changes: 39 additions & 20 deletions Public/assets/js/formContentUpdate.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,53 @@
function updateFormDisplay() {
const formvalue = document.getElementById("inputtextbot").value; // Assign variable to the current value of the textbox
$('#form_input').fadeOut('fast'); log(`No longer showing 'form_input' element`); // fade out previous content
fetch(`dataProcessing?data=${formvalue}`).then(response => response.json()).then(data => {
const formvalue = document.getElementById('inputtextbot').value; // Assign variable to the current value of the textbox
$('#form_input').fadeOut('fast'); // fade out previous content
log(`No longer showing 'form_input' element`);
function fetchData() {
return fetch(`dataProcessing?action=submit&data=${formvalue}`)
.then((response) => response.json())
.then((responseData) => {
return responseData;
}).catch(error => log(error, 'warn'));
}
fetchData().then(data => {
log(`Server responsed with '${data.response}'`);
document.getElementById("submissiontextbox").value = `${window.location}view?key=${data.response}`; log(`Updated 'submissiontextbox.value'`); // Set text box to view message URL
document.getElementById("submissiontextbox").innerHTML = `${window.location}view?key=${data.response}`; log(`Updated 'submissiontextbox.innerHTML'`); // Set text box to view message URL
document.getElementById('submissiontextbox').value = `${window.location}view?key=${data.response}`; // Set text box to view message URL
log(`Updated 'submissiontextbox.value'`);
document.getElementById('submissiontextbox').innerHTML = `${window.location}view?key=${data.response}`; // Set text box to view message URL
log(`Updated 'submissiontextbox.innerHTML'`);
});
setTimeout(function () {
$('#form_submission').fadeIn('fast'); log(`Now showing 'form_submission' element`); // fade in new content
setTimeout(() => {
$('#form_submission').fadeIn('fast'); // fade in new content
log(`Now showing 'form_submission' element`);
}, 200);
}

function updateViewDisplay() {
$('#form_confirmation').fadeOut('fast'); log(`No longer showing 'form_confirmation' element`); // fade out previous content
var key = new URL(window.location).searchParams.get("key"); log(`Got key variable from url -> ${key}`); // Get key variable from URL; replacing PHP usage
$('#form_confirmation').fadeOut('fast'); // fade out previous content
log(`No longer showing 'form_confirmation' element`);

let key = new URL(window.location).searchParams.get('key'); // Get key variable from URL; replacing PHP usage
log(`Got key variable from url -> ${key}`);

fetch(`dataProcessing?action=decrypt&key=${key}`).then(response => response.json()).then(data => {
if (data.response == "") {
if (!data.response) {
showSnackBar('snackbarError');
$('#form_error').fadeIn('fast'); log(`Now showing 'form_error' element`); // fade in new content
log(`Encryption not found; redirecting in 2s`)
setTimeout(function () {
window.location.replace("./"); // Redirect to home page
$('#form_error').fadeIn('fast'); // fade in new content
log(`Now showing 'form_error' element`);
log(`Encryption not found; redirecting in 2s`);
setTimeout(() => {
window.location.replace('./'); // Redirect to home page
}, 2000);
} else {
log(`Server responded with '${data.response}'`);
document.getElementById("valuetextbox").value = data.response; log(`Updated 'valuetextbox.value'`); // Set text box to decrypted message
document.getElementById("valuetextbox").innerHTML = data.response; log(`Updated 'valuetextbox.innerHTML'`); // Set text box to decrypted message
setTimeout(function () {
$('#form_content').fadeIn('fast'); log(`Now showing 'form_content' element`); // fade in new content
document.getElementById('valuetextbox').value = data.response; // Set text box to decrypted message
log(`Updated 'valuetextbox.value'`);
document.getElementById('valuetextbox').innerHTML = data.response; // Set text box to decrypted message
log(`Updated 'valuetextbox.innerHTML'`);
setTimeout(() => {
$('#form_content').fadeIn('fast'); // fade in new content
log(`Now showing 'form_content' element`);
}, 200);
}
log(`Server responded with '${data.response}'`);
};
});
}
35 changes: 26 additions & 9 deletions Public/assets/js/globalFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -5689,6 +5689,13 @@
//

document.addEventListener('DOMContentLoaded', function () {
fetch(`dataProcessing?action=isDebugMode`).then(response => response.json()).then(data => {
if (data.response == "false") {
console.log(
`[${moment().format('hh:mm:ss')}] [Initialisation/DEBUG] Debug mode is disabled!`
);
}
});
log(`${moment()}`, `Initialisation/DEBUG`);
log(`Successfully loaded all assets`, `Initialisation/DEBUG`);
}, false);
Expand All @@ -5707,13 +5714,23 @@ document.addEventListener('DOMContentLoaded', function () {
})

function log(content, type = null) {
if (!type) {
console.log(
`[${moment().format('hh:mm:ss')}] [Site Debug/INFO] ${content}`
);
} else {
console.log(
`[${moment().format('hh:mm:ss')}] [${type}] ${content}`
);
}
fetch(`dataProcessing?action=isDebugMode`).then(response => response.json()).then(data => {
if (data.response == "true") {
if (!type) {
console.log(
`[${moment().format('hh:mm:ss')}] [Site Debug/INFO] ${content}`
);
} else {
if(type == "warn"){
console.warn(
`[${moment().format('hh:mm:ss')}] ${content}`
);
} else{
console.log(
`[${moment().format('hh:mm:ss')}] [${type}] ${content}`
);
}
}
}
});
}
8 changes: 6 additions & 2 deletions Public/dataProcessing.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
/* Process the Data */
error_reporting(0);
header("Access-Control-Allow-Origin: *"); // "*" could also be a site such as http://www.example.com
if (!isset($_GET["action"]) || !$_GET["action"]) $_GET["action"] = "";

if ($_GET["action"] == "decrypt" && $_GET["key"]) {
echo '{"response": "' . htmlspecialchars(decryptData(htmlspecialchars($_GET["key"]))) . '", "key": "' . $_GET["key"] . '"}';
Expand All @@ -20,6 +21,9 @@
}
}
}
} else {
} else if ($_GET["action"] == "isDebugMode") {
$configuration = json_decode(file_get_contents("./.config", true), true);
echo '{"response": "' . $configuration["DEBUG_MODE"] . '"}';
} else if ($_GET["action"] == "submit") {
echo '{"response": "' . processData($_GET["data"]) . '"}';
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
<body class="text-center">

<main class="main-form">
<div class="errorCautionContainer">
<i class="fa-solid fa-triangle-exclamation fa-2xl darkmode-ignore errorCautionSymbol"></i>
</div>
<br>
<h1><?= translate("Database Error") ?></h1>
<br>
<h5 class="text-muted">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="<?=getInstallationPath()?>/Public/assets/img/favicon.png">
<link rel="icon" type="image/x-icon" href="<?= getInstallationPath() ?>/Public/assets/img/favicon-100x100.png">
<meta name="description" content="<?= translate("An extremely simple, one-time view encryption message system. Send anybody passwords, or secret messages on a one-time view basis.") ?>">
<title>QuickBlaze</title>

Expand All @@ -17,6 +17,10 @@
<body class="text-center">

<main class="main-form">
<div class="errorCautionContainer">
<i class="fa-solid fa-triangle-exclamation fa-2xl darkmode-ignore errorCautionSymbol"></i>
</div>
<br>
<h1><?= translate("Database Error") ?></h1>
<br>
<h5 class="text-muted">
Expand All @@ -39,4 +43,5 @@
<script src="https://momentjs.com/downloads/moment.js"></script>

</body>

</html>
File renamed without changes.
26 changes: 12 additions & 14 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,37 @@
/* Initialise Displays */
if ($url == "dataProcessing") {
/* Form Submission Handler */
require("./Modules/Functions.php");
//setupStorageMethod(); // Check database
require("./Modules/functions.php");
require("./Public/dataProcessing.php");
return;
}
if ($url == "view") {
/* View Message Page */
require("./Modules/Functions.php");
//setupStorageMethod(); // Check database
require("./Modules/functions.php");
require("./Public/view.php");
return;
}
if ($url == "") {
/* Primary Display Page */
require("./Modules/Functions.php");
setupStorageMethod(); // Check database
require("./Modules/functions.php");
initialiseSystem(); // Call system functions to initialise
require("./Public/index.php");
} elseif ($url == "404") {
/* Not Found Page */
require("./Modules/Functions.php");
return require("./Public/Error/404.php");
require("./Modules/functions.php");
return require("./Public/error_docs/404.php");
} elseif ($url == "403") {
/* Not Found Page */
require("./Modules/Functions.php");
return require("./Public/Error/403.php");
require("./Modules/functions.php");
return require("./Public/error_docs/403.php");
} else {
if ($url == "500") {
/* Server Error Page */
require("./Modules/Functions.php");
return require("./Public/Error/500.php");
require("./Modules/functions.php");
return require("./Public/error_docs/500.php");
} else {
/* Not Found Page */
require("./Modules/Functions.php");
return require("./Public/Error/404.php");
require("./Modules/functions.php");
return require("./Public/error_docs/404.php");
}
}

0 comments on commit c226cbd

Please sign in to comment.