0

I am working in an application using Drupal. Thru the UI I upload a text file that is then parse and each line store in the DB as a serialized array. So far so good until there.

I have setup a module using queue and the hook_cron that will check each of the serialize arrays from the DB and make a node out of it.

I was getting some odd errors like the cron was not able to parse the serialized array and I noticed something odd the array keys were been serialize with extra characters (invisible characters).

While looking in the DB imports I notice that something like the word "comunique" that when serialize should be like:

s:9:"comunique"

instead it was showing like:

s:12:"comunique"

also a print_r show me the following:

[comunique ‎] => Array (...)

I even test changing the word and there are always 3 characters extra. I tested locally in my computer and it is all good.

What am I missing? is this a server config issue or a code issue?

2
  • Hello. Title of your question looks like a series of tags. Could you please make it human readable? :) – Mołot Oct 7 '13 at 15:01
  • Can you post your code? Somewhere 3 characters are being added. – Steven Oct 7 '13 at 15:07
0

Thank you for your input. I open the PHP file with Notepad++ and there was the hidden tilde character. I remove it an everything started to work again like a charm.

For people having a similar issue, I will recommend opening the file in a different text editor.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.