Jump to content

netcarver

PW-Moderators
  • Posts

    2,241
  • Joined

  • Last visited

  • Days Won

    47

Everything posted by netcarver

  1. Bump. @Krlos, did you get this working?
  2. @Krlos, just writing to acknowledge your post. Please could you send me your site/ready.php file via the forum message system so I could have a look at it tonight? (Please don't post it here.)
  3. @mrkhan You are not handling the uploads correctly at the moment, take a close look at the first comment on the page horst pointed you to. It shows you what you need to know about handling file uploads. You should not trust the file-name supplied by the upload so that example shows you how to validate that the file was supplied via an upload (using the move_uploaded_file() function) how to name it without having to trust the supplied file name how to validate the mime type of the file how to append the extension that represents the file type of the uploaded file You just need to remember the name you gave it when you moved it and attach that to your outgoing email. I've updated part of the code from the comment I linked to so that you can see how you might generate the new name and extension. // You should name it uniquely. // DO NOT USE $_FILES['upfile']['name'] WITHOUT ANY VALIDATION !! // On this example, obtain safe unique name from its binary data. $new_name = "./uploads/" . sha1_file($_FILES['upfile']['tmp_name'] . ".$ext"; if (!move_uploaded_file($_FILES['upfile']['tmp_name'], $new_name))) { throw new RuntimeException('Failed to move uploaded file.'); } // Now attach the uploaded, validated & renamed file to your email. $mail->attachment($new_name); You'll need to tailor the code to do the needed validation on both of the files you want your users to upload of course. Don't forget to change where you want the files copied to as well.
  4. @cmscritic Mike, great to hear from you. I'd be very interested to know a little more about the holes in the PW offerings that compelled you to look at WP; there obviously are some, or you wouldn't have made the call to switch. I've never personally used WP, but I know people that like the theme-ability (is that a word?) and the large number of extensions that are available for it. It's also very popular with a large section of online entrepreneurs. I don't think we should get too emotional about folks' decisions to switch, as there are obviously a wide choice of tools around, but I would like to understand what is missing from the PW eco-system - and where possible, without detracting from Ryan's design decisions for PW - plug the gaps through well designed modules and site profiles. Thanks for all you've done in promoting PW and hope we can get you back to using it soon.
  5. I'm guessing, and this might not help much, but it sounds like output formatting might be off when you are not logged in.
  6. I didn't know you liked knitting, Adrian. I, too, like textiles.
  7. @Ivan Gretsky, there is a crypto module here that can create random token strings for you. If I remember correctly, you can just do this; $num_chars = 32; // The length of the token you want. Adjust as needed $random_key = CryptoPPP::genKeys(1); // Generates a seed key $token = CryptoPPP::keyToToken($random_key, $num_chars); // Convert to string token You can also define the character set that the random string is to use if you aren't happy with the default one. In fact, if you are going to use the token in a returned link, you'll definitely want to change the default character set used in the generation to only use url-safe characters.
  8. Thanks for adding me as a colaborator, @horst. I've pushed a new dev branch to the repository that contains, Bugfixes to the textfile driver's itemCount() method and small cleanups for edge cases. New methods isEmpty(), purgeItems() and getItems() added to the base storage class and fully implemented in the textfile driver. The SQLite driver currently has stub implementations of these that need filling out. The addition of a Redis driver for super-fast in-memory queues (implements the full base class interface.) If anyone wants to give this a try before horst gets around to merging into the master branch, feel free to grab the zip (repository here.)
  9. @kongondo - done, just in case.
  10. Ok, how about in the http server error log - not just PW's own log? If you are running on a *nix based machine, the server error logs are often found in a subdirectory of /var/log/ (on my local machine, the logs are in /var/log/httpd/error-<sitename>.log. If you are using php-fpm, you can check it's own logs too.
  11. Anything in the error or exception logs, @icreation?
  12. John, I've not done this before so I don't know for sure - but I'd guess at something like InputfieldImage::___fileAdded() - link.
  13. @adrian, I haven't actually given it much thought yet - that was a spur-of-the-moment posting, though I definitely wasn't thinking of using it for the core. Now I've spent a few more cycles on it, I can see that I have two different ways of using git for my PW-related stuff; For modules - in which case I just symlink in a subdirectory (suitably git init'd) from my master development directory so only some of the subdris in the site/modules/ directory will be git repos. For whole sites - in which case I install from the latest zip'd version of PW and then git init in the site/ subdirectory. I'm sure there will be other ways to do this too.
  14. @adrian, Git branch integration next?
  15. No Fitbit here, Pete. I do, however, use the pedometer app on my phone.
  16. Are any of the DB tables corrupt? You should be able to repair tables from within PHPMyAdmin. Also, is there an issue with free space on the server? I've had machines grind to a halt before when running out of space in the /var partition.
  17. @cb2004, Although this doesn't directly answer your question, have you had a look at formmailer's SchedulePages module? If you intend using your target selector to publish/unpublish pages I think you'll find his module has it covered.
  18. @horst Thanks for this module, I've been hammering it pretty hard for the past month and have just created a pull-request over on github for your consideration. I've been having a few reliability problems with the textfile driver's itemCount() method. I also wanted a fast way to purge a queue without having to call getItem() repeatedly. The itemCount() method sometimes returns an incorrect count (anywhere from 0 to the true number of items in the queue). This happens even when there are multiple thousands of jobs queued up and it makes it unreliable as part of a conditional statement. The explanation is given in the commit that fixes the issue as part of the pull request. Thanks for looking!
  19. @joer80, You should be able to use the PDO prepare(), bind() and execute() methods. Here's a short example; $statement = wire()->database->prepare("INSERT INTO `tablename` (`comments`) VALUES (:comment)"); $statement->bindParam(":comment", "The boat is 17' long. "); // Defaults to binding as a string. $statement->execute();
  20. Hello Pete, Just to clarify; are you getting a non-empty, but incorrectly sorted, result set for that selector?
  21. Hi JoshoB I think you need to escape your '/' characters. Could you try this and let us know if it works; $pattern = '#<p[^>]*>(\s| |<\/?\s?br\s?\/?>)*<\/?p>#';
  22. I've now added the useLocale() method to allow explicit setting of the locale as outlined above. This bumps the module to v1.1.0.
  23. Hi pwired, Thanks for taking a look. I guess it might just be my local Cloudflare Cloudfront node then. Anyone else from the UK seeing any issues?
  24. Over the past few weeks I've been seeing some weirdness when visiting the module repository. Here's a screenshot of how it appears for me this morning on Chromium; And here on FF; Visiting the module pages also shows some rendering issues; Anyone else seeing these issues? I'm seeing a lot of 502 errors for the page - mostly from cloudfront;
  25. Hi Adrian, Many thanks for that. I've just had word from the client that the new version of your module has their application up and running again. Outstanding response time!
×
×
  • Create New...