mzozoo
Forum Replies Created
-
Forum: Plugins
In reply to: [Contact Form 7] Problems with Checkboxes after UpdateHi,
I had the same problem after upgrading from version 5.9.8 to 6.0 yesterday (the value of the checkbox does not change to true in the background, even though the tick has appeared).
Today I rolled back to 5.9.8 and the checkbox works again (I don’t want to put extra jQuery codes on all our forms so far, it didn’t work for me anyway. Where would it have been worth putting it?).
Please investigate the real reason and fix it.
ThanksUnfortunately I can not.
The above issue can also be seen (programmed on a paper), if we also expect a file (not just for a folder) in the $path variable, we do not test with “is_dir”.Hi,
Your test site working successfully on your test environment, but on my (windows) environment the “else” branch activated, beacause of $out[1] equals “sample-page/” and preg_match(“/\/(.*)/”, $out[1])) returns false, so you append “index.html” to $out[1]:if(preg_match("/\/\(\.\*\)/", $out[1])){ $out[1] = str_replace("(.*)", "", $out[1]); $path = $this->getWpContentDir("/cache/all/").$out[1]; $mobile_path = $this->getWpContentDir("/cache/wpfc-mobile-cache/").$out[1]; }else{ $out[1] = $out[1]."index.html"; $path = $this->getWpContentDir("/cache/all/").$out[1]; $mobile_path = $this->getWpContentDir("/cache/wpfc-mobile-cache/").$out[1]; } if(!is_dir($this->getWpContentDir("/cache/tmpWpfc"))){ @mkdir($this->getWpContentDir("/cache/tmpWpfc"), 0755, true); if(is_dir($path)){ rename($path, $this->getWpContentDir("/cache/tmpWpfc/").time()); } if(is_dir($mobile_path)){ rename($mobile_path, $this->getWpContentDir("/cache/tmpWpfc/mobile_").time()); }It’s easy to see, if $path ends with “/cache/all/sample-page/index.html” then the is_dir($path) returns false and the rename() is not executed (the stored index.html file remains untouched). Because of the “else” branch (when index.html is appending), “file_exists()” should definitely be checked (if the file or directory exists). It is a programming bug (in the else branch the $path is set, but it is not used for anything). The $mobile_path existence checking has the same problem (if someone uses the Premium version).
Regards.Hi,
For example:
If I added this url https://www.domain.com/sample_page/ to the “Clearing Specific Pages” rules, nothing happened after a page refreshing (or creating), but if I changed the php like this (replace is_dir() to file_exists()):if(file_exists($path)){ rename($path, $this->getWpContentDir("/cache/tmpWpfc/").time()); }the index.html deleted (moved) successfully from /cache/all/sample_page/ folder.
Thanks