Thread Rating:
  • 44 Vote(s) - 3.36 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not Solved Plugin Changes coming in 1.6.5
#11
Not Solved
so we need to go from:

$plugins->add_hook("some hook name that is passed byref", "myplugin_for_the_hook");

function myplugin_for_the_hook($var_from_hook)


to

$plugins->add_hook("some hook name that is passed byval", "myplugin_for_the_hook");

function myplugin_for_the_hook(&$var_from_hook)


basically adding the "&" and we are all set?

<edit> the above if for the second set of hooks in the list, but the first set of hooks need this added to them?

return $var_passed_from_hook;
Lost interest, sold my sites, will browse here once in a while. It's been fun.
#12
Not Solved
(2011-10-28, 03:59 AM)pavemen Wrote: so we need to go from:

$plugins->add_hook("some hook name that is passed byref", "myplugin_for_the_hook");

function myplugin_for_the_hook($var_from_hook)


to

$plugins->add_hook("some hook name that is passed byval", "myplugin_for_the_hook");

function myplugin_for_the_hook(&$var_from_hook)


basically adding the "&" and we are all set?

For the ones in the second section of the wiki. In the first section you'll need to actually return the values.
#13
Not Solved
Here is a quick script that I put together that will check all your PHP file in the current folder for the hooks listed in the Wiki

Just upload it to the folder you want to check, usually just /inc/plugins and then open it in your browser.

Snapshot of example output below. For each PHP file, it looks for the hook name listed and outputs the type of issue (Return code or Reference Check), hook name and the function being called for that hook.

This should help authors find things they need to check/update and users to know what plugins they need to look for updated versions or to correct themselves.

http://community.mybb.com/thread-108595.html


Attached Files Thumbnail(s)
   
Lost interest, sold my sites, will browse here once in a while. It's been fun.
#14
Not Solved
Plugins affected by this will simply not 'work'. To fix it, you only need simple file changes to the function names - there is no need to deactivate/uninstall anything.
#15
Not Solved
(2011-10-28, 06:40 AM)pavemen Wrote: Here is a quick script that I put together that will check all your PHP file in the current folder for the hooks listed in the Wiki

Just upload it to the folder you want to check, usually just /inc/plugins and then open it in your browser.

Snapshot of example output below. For each PHP file, it looks for the hook name listed and outputs the type of issue (Return code or Reference Check), hook name and the function being called for that hook.

This should help authors find things they need to check/update and users to know what plugins they need to look for updated versions or to correct themselves.

So useful, thanks pavemen! I'm going to be performing the required updates later on today/tomorrow and this is definitely a help.
#16
Not Solved
there should be a way to fast-track plugins that are updated for this issue as I can see the queue for validation getting very long and a decent delay in approval
Lost interest, sold my sites, will browse here once in a while. It's been fun.
#17
Not Solved
(2011-10-28, 02:23 PM)pavemen Wrote: there should be a way to fast-track plugins that are updated for this issue as I can see the queue for validation getting very long and a decent delay in approval

I'll probably be handling that. I'd hope to get everything that is affected by this issue updated by the time 1.6.5 is ready for public release. Smile
#18
Not Solved
(2011-10-28, 06:40 AM)pavemen Wrote: Here is a quick script that I put together that will check all your PHP file in the current folder for the hooks listed in the Wiki

Just upload it to the folder you want to check, usually just /inc/plugins and then open it in your browser.

Snapshot of example output below. For each PHP file, it looks for the hook name listed and outputs the type of issue (Return code or Reference Check), hook name and the function being called for that hook.

This should help authors find things they need to check/update and users to know what plugins they need to look for updated versions or to correct themselves.

Thats awesome, thanks pavemen Smile

(2011-10-28, 07:45 AM)Tomm M Wrote: Plugins affected by this will simply not 'work'. To fix it, you only need simple file changes to the function names - there is no need to deactivate/uninstall anything.

Not entirely true... the ones that now require a "return" value will nuke whatever variable is assigned to them if it isn't returned. This could lead to a lot of complaints Wink
#19
Not Solved
(2011-10-28, 06:40 AM)pavemen Wrote: Here is a quick script that I put together that will check all your PHP file in the current folder for the hooks listed in the Wiki

Just upload it to the folder you want to check, usually just /inc/plugins and then open it in your browser.

Snapshot of example output below. For each PHP file, it looks for the hook name listed and outputs the type of issue (Return code or Reference Check), hook name and the function being called for that hook.

This should help authors find things they need to check/update and users to know what plugins they need to look for updated versions or to correct themselves.



So, we will replaced Hook Name by Function Called values? or what ?
Thanks!
#20
Not Solved
no, you need to find the function listed and correct it as needed. the "reference check" needs an "&" before the variable

function myfunction($var)

becomes

function myfunction(&$var)

for the return code you need to find the variable being passed and add as the last line of the function (usually)

return $var
Lost interest, sold my sites, will browse here once in a while. It's been fun.


Forum Jump:


Users browsing this thread: 1 Guest(s)