-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'staging' into deployment
- Loading branch information
Showing
7 changed files
with
59 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace App\Utils; | ||
|
||
class LatexSanitizer | ||
{ | ||
/** | ||
* Converts a single character to a \symbol{...} command | ||
* @param string $char | ||
* @return string $string | ||
*/ | ||
private static function convertCharToSymbol(string $char): string | ||
{ | ||
if($char == ' ') { | ||
return ' '; | ||
} | ||
return "\\symbol{" . mb_ord($char) . "}"; | ||
} | ||
|
||
/** | ||
* Converts string to a relatively safe Latex code by putting every character into a seperate \symbol{...} | ||
* @param string $data | ||
* @return string|null $string | ||
*/ | ||
public static function sanitizeLatex(string|null $data): string | ||
{ | ||
if($data == null) { | ||
return ""; | ||
} | ||
$len = mb_strlen($data); | ||
$result = []; | ||
for ($i = 0; $i < $len; $i++) { | ||
$result[] = LatexSanitizer::convertCharToSymbol(mb_substr($data, $i, 1)); | ||
} | ||
return implode($result); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
\documentclass[12pt,a4paper]{article} | ||
\usepackage[utf8]{inputenc} | ||
\usepackage[T1]{fontenc} | ||
\usepackage[magyar]{babel} | ||
\usepackage{amsmath} | ||
\usepackage{graphicx} | ||
\usepackage{multirow} | ||
|
||
\usepackage{caption} | ||
\usepackage[letterspace=300]{microtype} | ||
|
||
\usepackage{atbegshi} | ||
\usepackage{tikz} | ||
\usepackage[left=2cm, right=2cm, top=5cm, bottom=1cm]{geometry} | ||
|
@@ -45,7 +42,7 @@ | |
} | ||
\textsc{ | ||
{\scriptsize | ||
{{ \App\Models\User::director()?->name }}\\ | ||
{{ \App\Utils\LatexSanitizer::sanitizeLatex(\App\Models\User::director()?->name) }}\\ | ||
igazgató\\ | ||
} | ||
} | ||
|
@@ -56,7 +53,7 @@ | |
\begin{flushleft} | ||
{\scriptsize H-1118 Budapest, Ménesi út 11-13\\ | ||
Tel.: +36 1 460 4481 • Fax.: +36 1 209 2044 \\ | ||
E-mail: {{config("mail.secretary_mail")}} • {{\App\Models\User::director()?->email }} | ||
E-mail: {{ \App\Utils\LatexSanitizer::sanitizeLatex(config("mail.secretary_mail")) }} • {{ \App\Utils\LatexSanitizer::sanitizeLatex(\App\Models\User::director()?->email) }} | ||
% [email protected] • [email protected]\\ | ||
Honlap: https://eotvos.elte.hu/ } | ||
\end{flushleft} | ||
|
@@ -79,16 +76,16 @@ | |
\begin{document} | ||
\maketitle | ||
|
||
Alulírott {{ \App\Models\User::director()?->name }}, az ELTE Eötvös József Collegium igazgatója, hivatalosan igazolom, hogy {{ $name }} (Neptun-kód: {{ $neptun }}) az ELTE Eötvös József Collegium tagja {{ $from }}. szeptemberétől. | ||
Alulírott {{ \App\Utils\LatexSanitizer::sanitizeLatex(\App\Models\User::director()?->name) }}, az ELTE Eötvös József Collegium igazgatója, hivatalosan igazolom, hogy {{ \App\Utils\LatexSanitizer::sanitizeLatex($name) }} (Neptun-kód: {{ \App\Utils\LatexSanitizer::sanitizeLatex($neptun) }}) az ELTE Eötvös József Collegium tagja {{ \App\Utils\LatexSanitizer::sanitizeLatex($from) }}. szeptemberétől. | ||
|
||
A tagság érvényességének befejezése: {{ $until }} | ||
A tagság érvényességének befejezése: {{ \App\Utils\LatexSanitizer::sanitizeLatex($until) }} | ||
|
||
Személyes adatai: | ||
\begin{itemize} | ||
\itemsep0em | ||
\item születési helye és ideje: {{ $place_and_date_of_birth }} | ||
\item anyja neve: {{ $mothers_name }} | ||
\item állandó lakcíme: {{ $address }} | ||
\item születési helye és ideje: {{ \App\Utils\LatexSanitizer::sanitizeLatex($place_and_date_of_birth) }} | ||
\item anyja neve: {{ \App\Utils\LatexSanitizer::sanitizeLatex($mothers_name) }} | ||
\item állandó lakcíme: {{ \App\Utils\LatexSanitizer::sanitizeLatex($address) }} | ||
\end{itemize} | ||
|
||
|
||
|
@@ -98,7 +95,7 @@ | |
|
||
\begin{flushright} | ||
\begin{minipage}[t]{0.4\textwidth} | ||
\signature{ {{ \App\Models\User::director()?->name }} }{igazgató}{Eötvös József Collegium} | ||
\signature{ {{ \App\Utils\LatexSanitizer::sanitizeLatex(\App\Models\User::director()?->name) }} }{igazgató}{Eötvös József Collegium} | ||
\end{minipage} | ||
\end{flushright} | ||
|
||
|