-
-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from daison12006013/master
Resolving Compiler and Enhancing Test Suite
- Loading branch information
Showing
6 changed files
with
237 additions
and
13 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,22 @@ | ||
<?php | ||
|
||
return [ | ||
|
||
'users' => [ | ||
[ | ||
'id' => 1, | ||
'name' => 'John Doe', | ||
'email' => 'john.doe@doe.com', | ||
], | ||
[ | ||
'id' => 2, | ||
'name' => 'Jen Doe', | ||
'email' => 'jen.doe@example.com', | ||
], | ||
[ | ||
'id' => 3, | ||
'name' => 'Jerry Doe', | ||
'email' => 'jerry.doe@doe.com', | ||
], | ||
], | ||
]; |
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,56 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Test Title | ||
</title> | ||
</head> | ||
<body> | ||
|
||
Default<br> | ||
Still Default<br> | ||
|
||
<script type="text/javascript">alert("Hacked!");</script><br> | ||
|
||
Hello, <strong>John Doe</strong>.<br> | ||
|
||
hello <strong>John Doe</strong> | ||
<br> | ||
|
||
|
||
|
||
01/01/2017 23:59:59 <br> | ||
|
||
January 01, 2017 11:59 pm <br> | ||
|
||
You are not signed in. | ||
|
||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-sm-12"> | ||
<table class="table table-bordered"> | ||
<tr> | ||
<th>ID</th> | ||
<th>Name</th> | ||
<th>Email</th> | ||
</tr> | ||
<tr> | ||
<td>1</td> | ||
<td>John Doe</td> | ||
<td>john.doe@doe.com</td> | ||
</tr> | ||
<tr> | ||
<td>2</td> | ||
<td>Jen Doe</td> | ||
<td>jen.doe@example.com</td> | ||
</tr> | ||
<tr> | ||
<td>3</td> | ||
<td>Jerry Doe</td> | ||
<td>jerry.doe@doe.com</td> | ||
</tr> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
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,66 @@ | ||
@extends('main.layout') | ||
|
||
@section('title') | ||
Test Title | ||
@endsection | ||
|
||
@section('content') | ||
|
||
{{-- you must get 'Default' --}} | ||
{{ isset($name) ? $name : 'Default' }}<br> | ||
{{ $name or 'Still Default' }}<br> | ||
|
||
{{-- it must strip out this XSS sample --}} | ||
{{ '<script type="text/javascript">alert("Hacked!");</script>' }}<br> | ||
|
||
{{-- this must be bold --}} | ||
<?php $name = '<strong>John Doe</strong>' ?> | ||
Hello, {!! $name !!}.<br> | ||
|
||
{{-- using include directive --}} | ||
@include('variables', ['name' => $name]) <br> | ||
|
||
{{-- @each('variables', $users, 'name') <br> --}} | ||
|
||
<?php | ||
$dateObj = new DateTime('2017-01-01 23:59:59'); | ||
?> | ||
|
||
{{-- using object with() --}} | ||
<?php echo with($dateObj)->format('m/d/Y H:i:s'); ?> <br> | ||
|
||
{{-- using custom directive --}} | ||
@datetime($dateObj) <br> | ||
|
||
{{-- using unless, reversing 'true' --}} | ||
@unless ($auth_check = false) | ||
You are not signed in. | ||
@endunless | ||
|
||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-sm-12"> | ||
<table class="table table-bordered"> | ||
@if (count($users) > 0) | ||
<tr> | ||
<th>ID</th> | ||
<th>Name</th> | ||
<th>Email</th> | ||
</tr> | ||
@foreach ($users as $user) | ||
<tr> | ||
<td>{{ $user['id'] }}</td> | ||
<td>{{ $user['name'] }}</td> | ||
<td>{{ $user['email'] }}</td> | ||
</tr> | ||
@endforeach | ||
@else | ||
<tr> | ||
<td colspan="3">No users found!</td> | ||
</tr> | ||
@endif | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
@endsection |
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,9 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>@yield('title')</title> | ||
</head> | ||
<body> | ||
@yield('content') | ||
</body> | ||
</html> |