diff --git a/code/api.php b/code/api.php
index 3476aba..8f528e9 100644
--- a/code/api.php
+++ b/code/api.php
@@ -55,7 +55,7 @@ if (isset($_MGM['user']) && $_MGM['user']['level']==1 && $_MGM['path'][1]=="user
$level = (isset($_REQUEST['level']) ? trim($_REQUEST['level']) : "");
if (!empty($email) && !empty($level)) {
$salt = substr(sha1(rand()),0,12);
- $epassword = $salt.hash("sha512", $salt.hash("sha512", $password));
+ $epassword = $salt.hashPassword($password,hex2bin($salt));
databaseQuery("INSERT INTO users (email, password, time, level) VALUES (%s,%s,%d,%s)", $email, $epassword, $_MGM['time'], $level);
}
}
diff --git a/code/index.php b/code/index.php
index aa33757..270bf45 100644
--- a/code/index.php
+++ b/code/index.php
@@ -322,7 +322,7 @@ $(document).ready(function() {
repositionImage(2);
- if (urlHistory==undefined) {
+ if (urlHistory!=true) {
if (filter!="") {
window.history.pushState({state: currentState}, "=$_MGM['title']?>", "=$_MGM['installPath']?>?filter="+encodeURIComponent(filter));
} else {
diff --git a/code/logout.php b/code/logout.php
index 8bdae0f..9eda330 100644
--- a/code/logout.php
+++ b/code/logout.php
@@ -13,6 +13,8 @@
// DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
// ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
//
+
+databaseQuery("UPDATE users SET time=%d WHERE docid=%s", $_MGM['time'], $_MGM['user']['docid']);
setcookie("{$_MGM['CookiePrefix']}user_email", "", $_MGM['time'], $_MGM['CookiePath'], $_MGM['CookieDomain']);
setcookie("{$_MGM['CookiePrefix']}user_password", "", $_MGM['time'], $_MGM['CookiePath'], $_MGM['CookieDomain']);
header("location: ".generateURL());
diff --git a/code/upload.php b/code/upload.php
index a7f8c1e..136a040 100644
--- a/code/upload.php
+++ b/code/upload.php
@@ -88,18 +88,18 @@ if ($_MGM['path'][1]=="complete") {
$ocr .= $line;
}
}
- echo "OCR: ".$ocr."
\n";
+ echo "OCR: ".htmlspecialchars($ocr, ENT_COMPAT | ENT_HTML401, 'UTF-8', true)."
\n";
}
$tags = array();
$external_data = "";
$plugins = glob("./external_data_plugins/*.php");
- for ($i=0; $i
\n";
$thumbFile = "./thumbs/".$hash.".".$extension;
$target = 150;
@@ -142,16 +142,19 @@ if ($_MGM['path'][1]=="complete") {
Processing...