PHP Warning - Call-time pass-by-reference has been deprecated
ktleow - September 17, 2008 - 15:56
| Project: | Image Caption |
| Version: | 6.x-2.2 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
I've recently discovered that my Apache web server log file is flooded with this error:
PHP Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of preg_match(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in blablabla\\sites\\all\\modules\\image_caption\\contrib\\image_caption_filter.module on line 62
Nobody else had this problem? I couldn't find any other similar issue on this.

#1
Having the same issue.
#2
Not sure if this is the best solution to the issue, but if you go into image_caption_filter.module file and find the doImgTitles function, change all of the &$matches to just $matches. That seemed to fix it for me. I guess I need to figure out how to write a patch and submit it.
#3
No replies from the maintainer(s) ??
#4
Thanks for the code.
$matches doesn't need to be passed by reference anyway as it only stores the results of the preg_match evaluation in an array.
either that or setting allow_call_time_pass_reference to true in your php.ini
I think the above code should do the trick and I'll commit the update shortly for this contrib module.
regards,
DT
#5
Thank you for the response =)
I didn't know about this till my error log was flooded with this
allow_call_time_pass_referenceerrors.And since I'm using a shared hosting, asking them to enable
allow_call_time_pass_referenceisn't easy.#6
This has been fixed in the 6-2 dev version and released in the 6-2.3 tagged version
#7
Automatically closed -- issue fixed for two weeks with no activity.