Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
2a1c01f1
Commit
2a1c01f1
authored
Jul 06, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaning up HTML class bloat.
parent
28d11f15
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
18 deletions
+2
-18
html.php
system/html.php
+2
-18
No files found.
system/html.php
View file @
2a1c01f1
...
@@ -206,11 +206,8 @@ class HTML {
...
@@ -206,11 +206,8 @@ class HTML {
foreach
(
$attributes
as
$key
=>
$value
)
foreach
(
$attributes
as
$key
=>
$value
)
{
{
// -------------------------------------------------------
// Assume numeric-keyed attributes to have the same key and value.
// If the attribute key is numeric, assign the attribute
// Example: required="required", autofocus="autofocus", etc.
// value to the key. This allows for attributes such as
// "required", "checked", etc.
// -------------------------------------------------------
if
(
is_numeric
(
$key
))
if
(
is_numeric
(
$key
))
{
{
$key
=
$value
;
$key
=
$value
;
...
@@ -235,30 +232,21 @@ class HTML {
...
@@ -235,30 +232,21 @@ class HTML {
{
{
$safe
=
''
;
$safe
=
''
;
// -------------------------------------------------------
// Spin through the string letter by letter.
// -------------------------------------------------------
foreach
(
str_split
(
$value
)
as
$letter
)
foreach
(
str_split
(
$value
)
as
$letter
)
{
{
switch
(
rand
(
1
,
3
))
switch
(
rand
(
1
,
3
))
{
{
// -------------------------------------------------------
// Convert the letter to its entity representation.
// Convert the letter to its entity representation.
// -------------------------------------------------------
case
1
:
case
1
:
$safe
.=
'&#'
.
ord
(
$letter
)
.
';'
;
$safe
.=
'&#'
.
ord
(
$letter
)
.
';'
;
break
;
break
;
// -------------------------------------------------------
// Convert the letter to a Hex character code.
// Convert the letter to a Hex character code.
// -------------------------------------------------------
case
2
:
case
2
:
$safe
.=
'&#x'
.
dechex
(
ord
(
$letter
))
.
';'
;
$safe
.=
'&#x'
.
dechex
(
ord
(
$letter
))
.
';'
;
break
;
break
;
// -------------------------------------------------------
// No encoding.
// No encoding.
// -------------------------------------------------------
case
3
:
case
3
:
$safe
.=
$letter
;
$safe
.=
$letter
;
}
}
...
@@ -272,18 +260,14 @@ class HTML {
...
@@ -272,18 +260,14 @@ class HTML {
*/
*/
public
static
function
__callStatic
(
$method
,
$parameters
)
public
static
function
__callStatic
(
$method
,
$parameters
)
{
{
// -------------------------------------------------------
// Handle the dynamic creation of links to secure routes.
// Handle the dynamic creation of links to secure routes.
// -------------------------------------------------------
if
(
strpos
(
$method
,
'link_to_secure_'
)
===
0
)
if
(
strpos
(
$method
,
'link_to_secure_'
)
===
0
)
{
{
array_unshift
(
$parameters
,
substr
(
$method
,
15
));
array_unshift
(
$parameters
,
substr
(
$method
,
15
));
return
forward_static_call_array
(
'HTML::link_to_secure_route'
,
$parameters
);
return
forward_static_call_array
(
'HTML::link_to_secure_route'
,
$parameters
);
}
}
// -------------------------------------------------------
// Handle the dynamic creation of links to routes.
// Handle the dynamic creation of links to routes.
// -------------------------------------------------------
if
(
strpos
(
$method
,
'link_to_'
)
===
0
)
if
(
strpos
(
$method
,
'link_to_'
)
===
0
)
{
{
array_unshift
(
$parameters
,
substr
(
$method
,
8
));
array_unshift
(
$parameters
,
substr
(
$method
,
8
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment