Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Alto
/
rkn
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 4c88ee32
authored
2021-06-16 16:08:58 +0300
by
san58
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
изменил условие результирующео списа
+ добавил домена более 2-го уровня
1 parent
8bfd70ae
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
components/Collection.php
controllers/HostFreeController.php
components/Collection.php
View file @
4c88ee3
...
...
@@ -26,8 +26,17 @@ class Collection extends Component
''
,
utf8_encode
(
$domain
)
);
if
(
count
(
explode
(
'.'
,
$host
)
)
===
2
)
if
(
filter_var
(
$host
,
FILTER_VALIDATE_IP
)
===
false
)
{
$host_parts
=
explode
(
'.'
,
$host
);
$host_parts
=
array_reverse
(
$host_parts
);
$host_parts
=
array_slice
(
$host_parts
,
0
,
2
);
$host_parts
=
array_reverse
(
$host_parts
);
if
(
count
(
$host_parts
)
===
2
)
$out
=
$host
;
unset
(
$host_parts
);
}
unset
(
$host
);
return
$out
;
}
...
...
controllers/HostFreeController.php
View file @
4c88ee3
...
...
@@ -46,7 +46,7 @@ class HostFreeController extends Controller
*/
public
function
actionIndex
()
{
$searchModel
=
new
HostSearch
([
'wis_status'
=>
Host
::
STATUS_WIS_FREE
,
'status'
=>
Filter
::
STATUS_ON
,
'f1_status'
=>
Filter
::
STATUS_ON
,
'f2_status'
=>
Filter
::
STATUS_ON
,
'f3_status'
=>
Filter
::
STATUS_ON
]);
$searchModel
=
new
HostSearch
([
'wis_status'
=>
Host
::
STATUS_WIS_FREE
,
'status'
=>
Filter
::
STATUS_ON
,
'f1_status'
=>
Filter
::
STATUS_ON
]);
$dataProvider
=
$searchModel
->
search
(
Yii
::
$app
->
request
->
queryParams
);
return
$this
->
render
(
'index'
,
[
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment