Skip to content

Commit eb39949

Browse files
authored
fix(globals)!: disabled $_REQUEST super global function (#332)
BREAKING CHANGE: If you used `http_request_vars()` before it will now panic until a proper implementation is found. Refs: #331
1 parent 75ed264 commit eb39949

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/zend/globals.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use crate::ffi::{
1818
ext_php_rs_sapi_module, php_core_globals, php_file_globals, sapi_globals_struct,
1919
sapi_header_struct, sapi_headers_struct, sapi_request_info, zend_ini_entry,
2020
zend_is_auto_global, TRACK_VARS_COOKIE, TRACK_VARS_ENV, TRACK_VARS_FILES, TRACK_VARS_GET,
21-
TRACK_VARS_POST, TRACK_VARS_REQUEST, TRACK_VARS_SERVER,
21+
TRACK_VARS_POST, TRACK_VARS_SERVER,
2222
};
2323

2424
use crate::types::{ZendHashTable, ZendObject, ZendStr};
@@ -283,10 +283,18 @@ impl ProcessGlobals {
283283
}
284284

285285
/// Get the HTTP Request variables. Equivalent of $_REQUEST.
286+
///
287+
/// # Panics
288+
/// There is an outstanding issue with the implementation of this function.
289+
/// Untill resolved, this function will allways panic.
290+
///
291+
/// - <https://github.com/davidcole1340/ext-php-rs/issues/331>
292+
/// - <https://github.com/php/php-src/issues/16541>
286293
pub fn http_request_vars(&self) -> &ZendHashTable {
287-
self.http_globals[TRACK_VARS_REQUEST as usize]
288-
.array()
289-
.expect("Type is not a ZendArray")
294+
todo!("$_REQUEST super global was erroneously fetched from http_globals which resulted in an out-of-bounds access. A new implementation is needed.");
295+
// self.http_globals[TRACK_VARS_REQUEST as usize]
296+
// .array()
297+
// .expect("Type is not a ZendArray")
290298
}
291299

292300
/// Get the HTTP Environment variables. Equivalent of $_ENV.

0 commit comments

Comments
 (0)