ZenphotoCMS Forum
Akismet Fix - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Akismet Fix (/thread-1790.html)



Akismet Fix - libelle - 2007-11-10

I found that when I used Akismet anti-spam plugin, I was getting an error on line 196 of zenphoto/zp-core/plugins/spamfilters/akismet.php that it was missing parameter 1.

I rewrote the function. Not sure it's perfect, but it works for me.

function isError() {
return (isset($this->errors) && count($this->errors) > 0);
}




Akismet Fix - sbillard - 2007-11-10

I think what you want to do is change line 81: if ($akismet->isError()) {
to
`if (count($akismet->errors)) {'

I do not have the ability to test this (don't have an akismet key.) Thinkdreams did the implementation, he should comment on this fix.

Anyway, the isError() routine needs a parameter, which is what the complaint was. It seems that normally you pass it an error code and it will return true if the error exists and false if it does not. BUT, what I believe line 81 is trying to do is check if there are any errors. isError() is not the vehicle for that.




Akismet Fix - libelle - 2007-11-13

Your fix works correctly as well.

As the comments say, there's room for improvement in the error handling in that call anyway.




Akismet Fix - sbillard - 2007-11-13

We will release a fix to the SVN tonight. Thank you for your response.




Akismet Fix - Aegist - 2007-12-16

Thanks sbillard. I was having the same problem. Simple fix, all works well now.