FIX: fix escaping latin accents to HTML entities

This commit is contained in:
Michal Kváček
2016-04-08 01:21:44 +02:00
parent c99cee7a27
commit 951a8314b7
3 changed files with 20 additions and 7 deletions
+14
View File
@@ -0,0 +1,14 @@
<?php
/**
* Define function for escaping characters.
*
* This funcion prevents of creating build-in function, which escapes also accents...
*
* @param $value
*
* @return string
*/
function e($value)
{
return htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
}
+4 -5
View File
@@ -7,15 +7,14 @@
* @author Taylor Otwell <taylorotwell@gmail.com> * @author Taylor Otwell <taylorotwell@gmail.com>
*/ */
$uri = urldecode( $uri = urldecode(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));
parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
);
// This file allows us to emulate Apache's "mod_rewrite" functionality from the // This file allows us to emulate Apache's "mod_rewrite" functionality from the
// built-in PHP web server. This provides a convenient way to test a Laravel // built-in PHP web server. This provides a convenient way to test a Laravel
// application without having installed a "real" web server software here. // application without having installed a "real" web server software here.
if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { if ($uri !== '/' && file_exists(__DIR__ . '/public' . $uri)) {
return false; return false;
} }
require_once __DIR__.'/public/index.php'; require_once __DIR__ . '/app/Helpers/functions.php';
require_once __DIR__ . '/public/index.php';
+2 -2
View File
@@ -1,11 +1,11 @@
@extends('admin.layout') @extends('admin.layout')
@section('pageName', @trans('admin/contents.edit', ['name' => $page->title])) @section('pageName', @trans('admin/contents.edit', ['name' => e($page->title)]))
@section('content') @section('content')
<div class="row"> <div class="row">
<h2>@lang('admin/contents.edit', ['name' => $page->title])</h2> <h2>@lang('admin/contents.edit', ['name' => e($page->title)])</h2>
</div> </div>
<div class="row"> <div class="row">