Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix phpinfo segfaults #183

Merged
merged 2 commits into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions phper/src/modules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ unsafe extern "C" fn module_info(zend_module: *mut zend_module_entry) {

php_info_print_table_start();
if !module.version.as_bytes().is_empty() {
php_info_print_table_row(2, c"version", module.version.as_ptr());
php_info_print_table_row(2, c"version".as_ptr(), module.version.as_ptr());
}
if !module.author.as_bytes().is_empty() {
php_info_print_table_row(2, c"authors", module.author.as_ptr());
php_info_print_table_row(2, c"authors".as_ptr(), module.author.as_ptr());
}
for (key, value) in &module.infos {
php_info_print_table_row(2, key.as_ptr(), value.as_ptr());
Expand Down
1 change: 1 addition & 0 deletions tests/integration/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ fn test_cli() {
"integration",
),
&[
&tests_php_dir.join("phpinfo.php"),
&tests_php_dir.join("arguments.php"),
&tests_php_dir.join("arrays.php"),
&tests_php_dir.join("classes.php"),
Expand Down
13 changes: 13 additions & 0 deletions tests/integration/tests/php/phpinfo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

// Copyright (c) 2022 PHPER Framework Team
// PHPER is licensed under Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan
// PSL v2. You may obtain a copy of Mulan PSL v2 at:
// http://license.coscl.org.cn/MulanPSL2
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
// KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
// See the Mulan PSL v2 for more details.

phpinfo();
Loading