Fix var_export for resources
Debug builds hit an assert, and release builds would output something like array(}.
Esse commit está contido em:
@@ -69,6 +69,7 @@ void VariableSerializer::getResourceInfo(String &rsrcName, int &rsrcId) {
|
||||
void VariableSerializer::setResourceInfo(CStrRef rsrcName, int rsrcId) {
|
||||
m_rsrcName = rsrcName;
|
||||
m_rsrcId = rsrcId;
|
||||
m_objCode = 0;
|
||||
}
|
||||
|
||||
String VariableSerializer::serialize(CVarRef v, bool ret) {
|
||||
@@ -849,7 +850,7 @@ void VariableSerializer::writeArrayFooter() {
|
||||
case Type::VarExport:
|
||||
case Type::PHPOutput:
|
||||
indent();
|
||||
if (info.is_object) {
|
||||
if (info.is_object && m_objCode) {
|
||||
if (m_objCode == 'O') {
|
||||
m_buf->append("))");
|
||||
} else {
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
function test() {
|
||||
$f = fopen(__FILE__, "r");
|
||||
var_export($f);
|
||||
}
|
||||
|
||||
test();
|
||||
@@ -0,0 +1,2 @@
|
||||
array (
|
||||
)
|
||||
Referência em uma Nova Issue
Bloquear um usuário