logs archiveIRC Archive / Freenode / #php / 2015 / August / 6 / 1
Kirito
So would most regexes people use I imagine. As far as I understand coming up with a fully RFC compliant regular expression for emails is nearly impossible
jbc8
is it possible to do use if?
CoJaBo
I saw one once. It was like 8kb long =D
jbc8
like use a particular namespace if
retran
Kirito, dunno. i've never noticed a "most" solution for validating email. everyone always doing something different
pretty sure every framework has their own custom function for it :p
Kirito
Yeah, that's what I mean. Haha
Everyone thinks they can do it better :D
retran
you dont see too many fans of filter_var() tho
i dont blame them
mynameisbrian
so for name and body, there is no need to use FILTER_SANTIZE_STRING ? it's safe to directly pass the user input into PHPMailer methods?
retran
FILTER_SANTIZE_STRING is just weiird to me.
         

Kirito
No, don't try and sanitize HTML, that's evil.
use htmlspecialchars
retran
it's bad because it looks like it's important, but it's really strange what it does
mynameisbrian
ahh okay.
I'll just pass it. The emails don't have an HTML content type
retran
and you would be just as vulnerable possibly to all sorts of injection attacks all the same
mynameisbrian
so no need to filter out those
retran
are you letting user's create ad-hoc html to mail with your script
mynameisbrian
I read about \n in subjects being problematic, so I was just making sure there was nothing I'm missing
Kirito
I honestly think PHP's mail() function should be intelligent enough to handle things like that but I'm not 100% sure.
mynameisbrian
this is PHPMailer. I don't know how it works though, if it uses mail() internally or whatever. this is all new to me
Kirito
Oh, I have no idea what PHPMailer is.
mynameisbrian
I'm just using it because it's really simple. I found an example online where you can send emails through Google's servers.
retran
with php's mail function you can wack up and make unparsable email
especially you start doing html, mime stuff
Sammitch
1. don't use mail(), ever. 2. use PHPmailer.
mynameisbrian
yeah and I read just using mail() is a bad idea for whatever reason. I'm not a server admin, so I don't know sh*t about configuring email servers
retran
i never found using mail() to send html mail to be simple
Kirito
Hahah, I haven't used PHP's mail() in ages, I just use whatever my framework provides. PHPMailer looks really nice though
ElectricAlan_
looking to develop a smallish php application in symfony on my laptop while I'm travelling in a few weeks
Alphos
retran <html><body><p>really ?</body></html>
Sammitch
mail() assumes: 1. that you are intimately familiar with email RFCs and have set all the proper headers and have encoded your content properly. 2. that someone has properly configured the MTA on the server to send mail properly for *you*
ElectricAlan_
anyone able to suggest a good stack to use?
         

Alphos
ElectricAlan_ what kind of stack are you looking for ?
ElectricAlan_
that might not be the word I'm looking for, it's been a while since I have been a developer
retran
yes... Alphos. *that*
Alphos
retran ;)
ElectricAlan_
I don't mind, something that's not too taxing
not that my laptop isn't ok
but it's for development, not production
Alphos
ElectricAlan_ ok, so you want a VM. people will usually suggest puphpet, vagrant, and virtual box
Kirito
++Vagrant :D
ElectricAlan_
yeah I've used VMs before, was wondering if there isn't something native to windows that's easier
thebuccaneersden
++(++Vagrant) ^_^
runinsquares
nothing about developing on windows is easy :<
Alphos
ElectricAlan_ no. use a VM.
ElectricAlan_
I actually have a vm on here already from a previous job
Alphos
ElectricAlan_ use it.
AcidReign
I'd create a new one...
ElectricAlan_
the clever buggers had it set up to delete itself after a certain period of inactivity
Alphos
granted
AcidReign
only run one at a time though :P
ElectricAlan_
to protect their IP
yeah I'll jsut go get w/e distro
Alphos
AcidReign why... would... you... say... that ... ?...
ElectricAlan_
it's been a looooong time since I've had to pick a linux distro
AcidReign
Alphos: because he's got a weak laptop?
runinsquares
ElectricAlan_, what is the server running?
Alphos
ElectricAlan_ go for puphpet
Kirito
I use Vagrant to run a VM on my desktop. It leases a dedicated IP address from my router, and I use that to develop and test remotely on my laptop as well :D
AcidReign
Alphos: I've run 5 vms on my desktop, with out much strain :p
ElectricAlan_
I have virtualbox installed
but I don't really mind doing whatever else
Kirito
So no resources wasted on my laptop
Alphos
AcidReign : i'm in bed. laptops have their advantages too :p
ElectricAlan_
my laptop is (read: should be) pretty reasonable
runinsquares
well ubuntu boxes are pretty well supported
ElectricAlan_
(Action) runs off to fetch some specs
runinsquares
Alphos: the hero ##php needs
Alphos
ElectricAlan_ : pick something that mimicks your prod env as close as possible on puphpet, vagrant it up on your virtualbox, don't bother yourself with the tedious part of the job
ElectricAlan_
I don't have a production environment
AcidReign
ElectricAlan_: use a raspberypi for your mobile dev server ;)
ElectricAlan_
this is a simple DB app I've been supposed to make my dad for a few years and never got around to it
runinsquares
ElectricAlan_, then just take ubuntu/trusty64 or something, unless you find a box in the wildnerness with the goodies in it that you like already
ElectricAlan_
a simple front end for a database essentially
ubuntu will suffice I feel
AcidReign
ElectricAlan_: look for frameworks with scaffolding tools
Alphos
go. pick. up. use.
ElectricAlan_
like I probably could have figured this out for myself, but there's something about the dev communnity that I like (when I get help)
idk makes me feel more included and part of it
Alphos
or "go. choose. up. use." : it rhymes !
AcidReign
ElectricAlan_: they generate most of the CRUD pages for you, based on the schema, then you just customize
Kirito
I don't bother trying to mimick my production environment in development
I have a staging server for that :D
ElectricAlan_
btw 2.5gHZ amd processor, readeon graphics and 16Gb DDR3 RAM
Kirito
Makes life a bit easier
AcidReign
Kirito: just clone the production VM, and mirage it to your desktop :p
ElectricAlan_
(Action) feels contented
Alphos
ElectricAlan_ : your laptop ?
ElectricAlan_
thanks all, I've been unemployed and miserable for much of this year. I think jsut now is the first time I felt that sense that I'm going to be ok and don't need to crawl into a well of despair of my own making
Alphos, yes
Alphos
nice. you might even cut 2 or 3 VMs without feeling too much effect
lasdam
can I pass basically an array of parameters as each individual element to a function/method somehow? example: function test($a, $b, $c); $array = (1, 2, 3); now how can I pass these 3 elements to the function test?
Kirito
My laptop has 16GB of RAM, I manage to eat all of that up without any VM's running sometimes
Yay having 100+ tabs open in Chrome/Opera
Alphos
Kirito drop the pr0n...
Kirito
and IDE's
Alphos
as i said, drop the pr0n :p
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 next »