File tree Expand file tree Collapse file tree 2 files changed +10
-12
lines changed
Expand file tree Collapse file tree 2 files changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -611,7 +611,14 @@ function TZendVariable.GetAsString: zend_ustr;
611611 end ;
612612
613613 case { $IFDEF PHP7} FValue^.u1.v._type{ $ELSE} FValue^._type{ $ENDIF} of
614- IS_STRING : result := Z_STRVAL(FValue);
614+ IS_STRING : begin
615+ try
616+ SetLength(Result, FValue^.value .str.len);
617+ Move(FValue^.value .str.val^, Result[1 ], FValue^.value .str.len);
618+ except
619+ Result := ' ' ;
620+ end ;
621+ end ;
615622 IS_DOUBLE : result := FloatToStr(FValue^.value .dval);
616623 IS_LONG : result := IntToStr(FValue^.value .lval);
617624 IS_NULL : result := ' ' ;
Original file line number Diff line number Diff line change @@ -1552,11 +1552,7 @@ procedure VariantToZend(const Value:Variant;z:pzval;
15521552 end ;
15531553
15541554 varUString : // Peter Enz
1555- begin
1556- S := string(TVarData(Value ).VUString);
1557-
1558- ZVAL_STRING(z, zend_pchar(zend_ustr(S)), true);
1559- end ;
1555+ ZVAL_RawStr(z, RawByteString(TVarData(Value ).VUString), true);
15601556
15611557 varOleStr : // Peter Enz
15621558 begin
@@ -1629,12 +1625,7 @@ procedure VariantToZend(const Value:Variant;z:pzval;
16291625 end ;
16301626 end ;
16311627
1632- varUStrArg : // Peter Enz
1633- begin
1634- S := string(TVarData(Value ).VUString);
1635-
1636- ZVAL_STRING(z, zend_pchar(zend_ustr(S)), true);
1637- end ;
1628+ varUStrArg : ZVAL_RawStr(z, RawByteString(TVarData(Value ).VUString), true);
16381629 varInt64 : ZVALVAL(z, TVarData(Value ).VInt64);
16391630 varUInt64 : ZVALVAL(z, TVarData(Value ).VUInt64);
16401631 varShortInt : ZVALVAL(z, Integer(TVarData(Value ).VShortInt));
You can’t perform that action at this time.
0 commit comments