Commit 87be251f authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Die Inputs im Formular enthielten ungültige Zeichen (".", ...)

Ich lasse die Namen der Variablen nun einfach Base64 enkodieren und mache das ganze beim auslesen wieder rückgängig.
parent 37f895fa
......@@ -123,16 +123,17 @@ class MailController extends Controller
public function sendLanguageFile(Request $request, $from, $to, $exclude = "")
{
$filename = $request->input('filename');
# Wir erstellen nun zunächst den Inhalt der Datei:
$data = [];
$new = 0;
foreach ($request->all() as $key => $value) {
if ($key === "filename" || $value === "") {
continue;
}
$key = base64_decode($key);
if (strpos($key, "_new_") === 0 && $value !== "") {
$new++;
$key = substr($key, strpos($key, "_new_") + 5);
......@@ -151,6 +152,7 @@ class MailController extends Controller
}
}
$output = json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
$output = preg_replace("/\{/si", "[", $output);
$output = preg_replace("/\}/si", "]", $output);
......
......@@ -37,13 +37,12 @@
@else
<tr>
<td class="name">{{preg_replace("/(\s*).*#(.*)$/si", "$1$2", $name)}}</td>
<td>@if(isset($langValues[$to])) <textarea type="text" rows="1" cols="50" form="submit" name="{{$name}}" readonly >{{$langValues[$to]}}</textarea> @else <textarea rows="1" cols="50" form="submit" name="_new_{{$name}}" ></textarea> @endif</td>
<td>@if(isset($langValues[$to])) <textarea type="text" rows="1" cols="50" form="submit" name="{{ base64_encode($name) }}" readonly >{{$langValues[$to]}}</textarea> @else <textarea rows="1" cols="50" form="submit" name="{{base64_encode("_new_" . $name)}}" ></textarea> @endif</td>
@foreach($langs as $lang => $value)
<td>{!! $langValues[$lang] or "" !!}</td>
@endforeach
</tr>
@endif
@endforeach
</tbody>
</table>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment