Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
phpdts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nemo Ma
phpdts
Commits
a8e9523d
Commit
a8e9523d
authored
Feb 11, 2026
by
Nemo Ma
Committed by
GitHub
Feb 11, 2026
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #226 from amarillonmc/codex/add-game-resource-management-section-f74uej
Codex-generated pull request
parents
92e32fa0
189209f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
include/admin/resourcemng.php
include/admin/resourcemng.php
+19
-1
No files found.
include/admin/resourcemng.php
View file @
a8e9523d
...
...
@@ -265,7 +265,13 @@ function resourcemng_collect_row($res_type, $input, $default){
$size
=
count
(
resourcemng_columns
(
$res_type
));
for
(
$i
=
0
;
$i
<
$size
;
$i
++
)
{
$val
=
isset
(
$input
[
'col_'
.
$i
])
?
trim
(
$input
[
'col_'
.
$i
])
:
''
;
$row
[
$i
]
=
str_replace
(
array
(
"
\n
"
,
"
\r
"
,
','
),
array
(
''
,
''
,
','
),
$val
);
$val
=
str_replace
(
array
(
"
\n
"
,
"
\r
"
),
array
(
''
,
''
),
$val
);
// 最后一列是 itmpara(JSON),必须保留半角逗号
if
(
$i
===
$size
-
1
)
{
$row
[
$i
]
=
$val
;
}
else
{
$row
[
$i
]
=
str_replace
(
','
,
','
,
$val
);
}
}
return
$row
;
}
...
...
@@ -280,6 +286,18 @@ function resourcemng_validate_row($res_type, $row, &$err){
$err
=
'首字段不能为空'
;
return
false
;
}
// CSV 资源的最后一列为 itmpara,若填写则应为合法 JSON
$last
=
count
(
$row
)
-
1
;
if
(
$last
>=
0
)
{
$itmpara
=
trim
(
$row
[
$last
]);
if
(
$itmpara
!==
''
&&
$itmpara
!==
'null'
)
{
json_decode
(
$itmpara
,
true
);
if
(
json_last_error
()
!==
JSON_ERROR_NONE
)
{
$err
=
'itmpara 不是合法JSON:'
.
json_last_error_msg
();
return
false
;
}
}
}
return
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