Skip to content

Commit bc2bd33

Browse files
committed
docs: fix CI3 sample code
Even when CI3 is used, protection against XSS is of course necessary.
1 parent bffd864 commit bc2bd33

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

  • user_guide_src/source/installation

user_guide_src/source/installation/upgrade_controllers/ci3sample/001.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ class Helloworld extends CI_Controller
44
{
55
public function index($name)
66
{
7-
echo "Hello $name! ";
7+
echo 'Hello ' . html_escape($name) . '!';
88
}
99
}

user_guide_src/source/installation/upgrade_views/ci3sample/001.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<html>
22
<head>
3-
<title><?php echo $title; ?></title>
3+
<title><?php echo html_escape($title); ?></title>
44
</head>
55
<body>
6-
<h1><?php echo $heading; ?></h1>
6+
<h1><?php echo html_escape($heading); ?></h1>
77

88
<h3>My Todo List</h3>
99

1010
<ul>
1111
<?php foreach ($todo_list as $item): ?>
12-
<li><?php echo $item; ?></li>
12+
<li><?php echo html_escape($item); ?></li>
1313
<?php endforeach; ?>
1414
</ul>
1515

0 commit comments

Comments
 (0)