Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
UserAdminV2
Overview
Overview
Details
Activity
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
UserAdminV2
Commits
36d9fe0b
Commit
36d9fe0b
authored
Jul 22, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Form::open_secure and Form::open_secure_for_files
parent
64351b22
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
4 deletions
+32
-4
system/form.php
+32
-4
No files found.
system/form.php
View file @
36d9fe0b
...
...
@@ -15,11 +15,12 @@ class Form {
* @param string $action
* @param string $method
* @param array $attributes
* @param bool $https
* @return string
*/
public
static
function
open
(
$action
=
null
,
$method
=
'POST'
,
$attributes
=
array
())
public
static
function
open
(
$action
=
null
,
$method
=
'POST'
,
$attributes
=
array
()
,
$https
=
false
)
{
$attributes
[
'action'
]
=
HTML
::
entities
(
URL
::
to
((
is_null
(
$action
))
?
Request
::
uri
()
:
$action
));
$attributes
[
'action'
]
=
HTML
::
entities
(
URL
::
to
((
(
is_null
(
$action
))
?
Request
::
uri
()
:
$action
),
$https
));
// If the request method is PUT or DELETE, we'll default the request method to POST
// since the request method is being spoofed by the form.
...
...
@@ -43,18 +44,45 @@ class Form {
}
/**
* Open a HTML form with a HTTPS action.
*
* @param string $action
* @param string $method
* @param array $attributes
* @return string
*/
public
static
function
open_secure
(
$action
=
null
,
$method
=
'POST'
,
$attributes
=
array
())
{
return
static
::
open
(
$action
,
$method
,
$attributes
,
true
);
}
/**
* Open a HTML form that accepts file uploads.
*
* @param string $action
* @param string $method
* @param array $attributes
* @param bool $https
* @return string
*/
public
static
function
open_for_files
(
$action
=
null
,
$method
=
'POST'
,
$attributes
=
array
())
public
static
function
open_for_files
(
$action
=
null
,
$method
=
'POST'
,
$attributes
=
array
()
,
$https
=
false
)
{
$attributes
[
'enctype'
]
=
'multipart/form-data'
;
return
static
::
open
(
$action
,
$method
,
$attributes
);
return
static
::
open
(
$action
,
$method
,
$attributes
,
$https
);
}
/**
* Open a HTML form that accepts file uploads with a HTTPS action.
*
* @param string $action
* @param string $method
* @param array $attributes
* @return string
*/
public
static
function
open_secure_for_files
(
$action
=
null
,
$method
=
'POST'
,
$attributes
=
array
())
{
return
static
::
open_for_files
(
$action
,
$method
,
$attributes
,
true
);
}
/**
...
...
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