#9441 closed enhancement (wontfix)
Code Quality: Use of a global Variable instead of a function with a static local variable
Reported by: | hakre | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | General | Keywords: | needs-patch |
Focuses: | Cc: |
Description
function force_ssl_admin (wp-includes/functions.php line ~2963ff) only exists to set a static variable inside that function.
instead a global variable can be used.
even the global variable might not be used, because since 2.6 a constant FORCE_SSL_ADMIN does exists.
I suggest to remove the function and replace the places where it is called with either setting a (global) variable or getting it.
Change History (6)
#4
follow-up:
↓ 5
@
15 years ago
- Milestone 2.9 deleted
- Resolution set to wontfix
- Status changed from new to closed
Those functions provide for overriding the FORCE_SSL constants. Removing them would cause back compat issues.
#5
in reply to:
↑ 4
@
15 years ago
- Keywords needs-patch added
Replying to ryan:
Those functions provide for overriding the FORCE_SSL constants. Removing them would cause back compat issues.
ryan, you didn't get my point. those functions are in there soley for the case to mimic the behaviour of a global variable. not that I very much global variables, but these functions can be called as "an implementation of a global variable".
same for force_ssl_login(), even code duplication here!