From 33f1938b505d40a56b13d0b76e9635768d9b813e Mon Sep 17 00:00:00 2001
From: Marius Burkard <m.burkard@pixcept.de>
Date: Wed, 02 Mar 2016 05:21:00 -0500
Subject: [PATCH] - another addition on coding guidelines (PHP 5.3)

---
 interface/web/admin/language_import.php |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/interface/web/admin/language_import.php b/interface/web/admin/language_import.php
index d53575b..be822cf 100644
--- a/interface/web/admin/language_import.php
+++ b/interface/web/admin/language_import.php
@@ -36,7 +36,7 @@
 	$new_string = '';
 
 	for($c = 0; $c < mb_strlen($string); $c++) {
-		$char = $string{$c};
+		$char = mb_substr($string, $c, 1);
 
 		if($in_string === true && $escaped === false && $char === $quote) {
 			// this marks a string end (e.g. for concatenation)
@@ -129,6 +129,10 @@
 
 // Export the language file
 if(isset($_FILES['file']['name']) && is_uploaded_file($_FILES['file']['tmp_name'])) {
+	
+	//* CSRF Check
+	$app->auth->csrf_token_check();
+	
 	$lines = file($_FILES['file']['tmp_name']);
 	// initial check
 	$parts = explode('|', $lines[0]);
@@ -183,6 +187,11 @@
 $app->tpl->setVar('msg', $msg);
 $app->tpl->setVar('error', $error);
 
+//* SET csrf token
+$csrf_token = $app->auth->csrf_token_get('language_import');
+$app->tpl->setVar('_csrf_id',$csrf_token['csrf_id']);
+$app->tpl->setVar('_csrf_key',$csrf_token['csrf_key']);
+
 //* load language file
 $lng_file = 'lib/lang/'.$_SESSION['s']['language'].'_language_import.lng';
 include $lng_file;

--
Gitblit v1.9.1