From 9b824a0788c3dc704428c1ee75d92550763946ab Mon Sep 17 00:00:00 2001 From: sergiotarxz Date: Tue, 28 Jul 2020 20:12:22 +0200 Subject: [PATCH 1/2] Sanitizing html output and using page.php Issues #1 and #4 --- index.php | 8 +++- php/home.php | 100 ++++++++++++--------------------------------- php/page.php | 40 ++++++++++-------- php/pagination.php | 42 +++++++++++++++++++ 4 files changed, 100 insertions(+), 90 deletions(-) create mode 100644 php/pagination.php diff --git a/index.php b/index.php index cfce00e..74f1890 100755 --- a/index.php +++ b/index.php @@ -16,7 +16,13 @@
- +
diff --git a/php/home.php b/php/home.php index df86469..97b6bd2 100644 --- a/php/home.php +++ b/php/home.php @@ -1,77 +1,31 @@ -
- - +
- - + diff --git a/php/page.php b/php/page.php index 3a72773..a858afc 100644 --- a/php/page.php +++ b/php/page.php @@ -1,18 +1,26 @@ -
- -
\ No newline at end of file + content() ?> + + + + + + diff --git a/php/pagination.php b/php/pagination.php new file mode 100644 index 0000000..1b9d9c6 --- /dev/null +++ b/php/pagination.php @@ -0,0 +1,42 @@ + + From 146cacd16f4a89377474f0f31b38915ae8fdfbdb Mon Sep 17 00:00:00 2001 From: sergiotarxz Date: Tue, 28 Jul 2020 20:16:42 +0200 Subject: [PATCH 2/2] fix: Solving unsanitized data left. Issues #1 and #4 --- php/home.php | 2 +- php/page.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/php/home.php b/php/home.php index 97b6bd2..038c81c 100644 --- a/php/home.php +++ b/php/home.php @@ -13,7 +13,7 @@ coverImage()): ?> - <?php echo $page->slug(); ?> + <?php htmlentities(echo $page->slug(), ENT_QUOTES | ENT_HTML401); ?> content() ?> diff --git a/php/page.php b/php/page.php index a858afc..dbba5be 100644 --- a/php/page.php +++ b/php/page.php @@ -18,7 +18,7 @@ content() ?>