J
J
John FireFly2016-08-02 17:14:01
SOAP
John FireFly, 2016-08-02 17:14:01

How to fix what, Bitrix CMS translates an array into a string?

There is a site that SOAP takes data from 1s-ki.
Let's say in 1-sk there is a table in which there can be any number of rows.
In any scenario from 1-ski, this table flies away in an array.
The problem is that if there is only one string in the array (an array of one value), then when Bitrix parses, the array is converted into a string for some reason.

(problems arise because some functions on the site expect to receive an array, and Bitrix shoves a string to them - as a result, everything crashes.
Currently fixed in the following way - if Bitrix shoves a "string" then I turn it into an array with a hardcode (wrapped), but that's not appropriate.)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Harakhnin, 2016-08-02
@Chupokabr

The problem is not disclosed, but what is the difficulty in checking for an array before using it?
for example

if(!is_array($res))
{
   $res = array($res);
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question