« first day (838 days earlier)      last day (4335 days later) » 

20:00
youtube.com/watch?v=LXO-jKksQkM not sure if After Effects or real... It's real, but still..
the only use case for using references in PHP is to willingly create bugs
LOL
but not entirely true?
@webarto sounds healthy
@ircmaxell True most of the time.
@LeviMorrison one could argue any issue you need references to solve is likely an architectural issue anyway...
20:15
Use of references for mutable lexical scoping: gist.github.com/4683373#file-array-dic-php-L16
@igorw that's because PHP doesn't have closures
It just looks like a closure. Functionally, it's different because the scopes are disjoint (forcing references for functionality that closures are supposed to provide out of the box)
would it be correct to say that you need to use references to simulate lexical scoping?
and yes, static would be the other way to accomplish the same thing :) that's how pimple does it
is this function sufficient for basic security for a website? `function filter($value) {
if (get_magic_quotes_gpc())
$value = stripslashes($value);
if (!is_numeric($value))
$value = $this->connection->real_escape_string($value);
return htmlspecialchars(trim($value));
}`
user1105787
@iroegbu Don't use Magic quotes or stripslashes, just disable it. Remember that isnumeric () allows +0123.45e6, not just postive/negative integers.
emm ... guys , how would you go about unit-testing this method ?
i think it needs to be refactored at first
20:26
@DavidEugenePeterson oh... good one! Will change that pronto
thanks
@tereško why the @codeCoverageIgnore on createRoutes ? Doesn't seem like something hard to test to me
@iroegbu no, that's not
because it's protected or private (i don't even have to look at code)
never touch the value after you escape it for database ingestion. You're trimming and running htmlspecialchars after, which can result in unpredicatable vulnerabilities...
@igorw thats what happens when you spend too much time on SO
20:30
@ircmaxell ok... reordering should fix that?
@tereško @SalmanA do you have any more in-depth explanation of that reasoning, because it doesn't make any sense to me at all.
@iroegbu No, separate the logic
don't run htmlspecialchars unless you're directly outputting to HTML.
so move it from save-time to output time
@igorw sorry wrong @
@igorw the general consensus is that you do not write unit tests for protected/private methods
@tereško basically, I would setup "test stories", perhaps 4 or 5 different workflows that test the different conditions (one match, multiple matches, no match, etc)
20:34
@ircmaxell I'm trying to sanitize strings before inserting into database... :s
@tereško I found this quite a good read: edorian.posterous.com/the-unit-in-unit-testing
I don't use that for SELECTS
@iroegbu I know, that's why you shouldn't have anything to do with HTML in there. Leave the escaping for the type of output
only INSERTS and UPDATES
@iroegbu You are mistaking where the input needs to be filtered and validated.
You should be filtering for HTML immediately on input.
20:35
@iroegbu Don't escape for HTML when you insert into the database...
But you shouldn't be escaping for database manipulation until you're manipulating it in the database.
Data in database should be raw
SXtupid wrong copy paste
46
A: What are the best PHP input sanitizing functions?

CharlesStop! You're making a mistake here. Oh, no, you've picked the right PHP function calls to make data a bit safer, that's fine. Your mistake is one of order of operations and the intent of the functions. When users submit data, you need to make sure that the data is the form you expect. If y...

An old answer, but it tries to explain how/why.
20:37
@Charles nice answer
@Michael Thanks! I plan on updating it one of these days. I was following some old "best formatting practices" at the time and now it looks all weird with the random-ass bolding.
@Charles You should only bold the first sentence in each paragraph, would look more consistent.
Like instead of "Overall, you need to remember to use the right type of data filtering on the right data at the right time."
@Charles You may want to add that most people really shouldn't use htmlentities
Yeah, basically doing subheaders.
Just do "Use the right type of data filtering on the right data at the right time."
yea
20:42
@PeeHaa Yeah, I kinda touch on it at the end, but not why it's such a horrible idea most of the time.
Ok... my logic around sanitizing was data was wrong from the onset
I was scared and trying to avoid injection
Don't be scared of it, embrace it.
didn't want to have HTML codes in my database
You must be one with the vulnerabilities. Only then can you defend against their foul taint.
@webarto lol
20:48
Let the innerHTML guide you.
4
@webarto lol
Now I have a problem of re-displaying the saved strings
@ircmaxell I wish I'd thought of that instacode :P
peehaa don't curse
20:49
@webarto read the code though, I want to know WTF it's doing
@Michael It's called ventilating. It's either that or something will be broken
1 message moved to Trash can
@Michael I can always trash it later :)
@PeeHaa oh ok
@ircmaxell Upper is redirect obviously, then it tries one selector and the the other, I have no clue :)
20:55
but selector as array access?
noooooooooooh my precious message
sorry i didn't mean for it to get deleted
@Charles i want that mug
omg
nice
i'm going to buy it when i get home
@ircmaxell Stupid assumption: CSS selectors are the keys, XPath is the value :)
20:59
@webarto eih
@ircmaxell Maybe someone got "creative" with an ArrayObject?
(array) DOMDocument
:)
@Charles that's what I'm thinking of
Regardless, $dom['html > body'] would be same as $dom->whatever('html > body')? Either way, I don't get it...
21:21
Yay. Touched my keyboard for the first time in aaaaaages. +1 for spare time
21:36
anyone here familiar with western-style comics ?
I've done the math enough to know the dangers of second guessing...
Why not ask him? :)
I thought this instacode is open sauce... lame...
I'm guessing QueryableDOMDocument extends DOMDocument implements ArrayAccess
(evening @all)
Whatever it is, that array access is obviously returning a DOMNodeList, so it must be a fairly thin wrapper over DOMXPath::query()
Yup... morning @DaveRandom, how was your day?
Dull, to be honest. I spent a long time just waiting for a huge batch of emails to send so I could check the bouncebacks and try and fix some of them
(the input data was pretty unsanitised)
21:52
bye
I know that feeling... Currently I have an issue which is driving me nuts... . (dot) is eaten if it's last character in quoted printable email format, so when assembled/rendered, link is broken...
@webarto So you mean you have a dot on a line on it's own? I don't quite follow what you're saying there, but if that ^^ is the case then SMTP will eat it.
@DaveRandom i.imgur.com/VG6bupi.png For example, if there is (there should be) . right before last = in line (in original email), it is stripped out of received email. So, e.g. webarto.com becomes webartocom... Thanks :)
is there any reason that this is not working? precisely this statement: Posts.CreationDate = @CreationDate work with > or < but not with =
See, link to image is broken.
So, dot gets eaten by SMTP, first one is sent email, second one is received.
22:11
@Lucio ##CreationDate:string## - if you don't specify the type, the date gets cast to a number.
@DaveRandom You are right, that is useful. But it doesn't solve the problem with the = character. Thanks for that!
@webarto http://s5.webarto.com/gfx/sad=3D.png
@DaveRandom Sorry, mate, not following :)
@webarto Possibly me neither, I can't relate the diff to the image you posted, can you pastebin the in and out texts?
@webarto s5.webarto.com/email.php nice filler text
22:18
@Lusitanian I added some text from redtube etc too see how spam score is doing :)
@DaveRandom gist.github.com/f8a14e6245d6c24b9589 and gist.github.com/3cf7dcad2c9c63ac4b4a (CTRL + F > sad), notice who in second one, there is no dot in the link. Crappy server maybe...
F* it :)
Where in the wall of text is that bit I am looking at? :-P
CTRL + F ... sad :P
Ahh right sorry
22:26
1st LoC 73, 2nd LoC 100
Where is my bloody dot.
Why is that = sign in there?
That's what's doing you over
What is that actual URL of the file?
http://s5.webarto.com/gfx/sad.png
Quoted-printable, or QP encoding, is an encoding using printable ASCII characters (alphanumeric and the equals sign "=") to transmit 8-bit data over a 7-bit data path or, generally, over a medium which is not 8-bit clean. It is defined as a MIME content transfer encoding for use in e-mail. QP works by using the equals sign "=" as an escape character. It also limits line length to 76, as some software has limits on line length. Introduction MIME defines mechanisms for sending other kinds of information in e-mail, including text in languages other than English, using character encodings oth...
> Any 8-bit byte value may be encoded with 3 characters: an "=" followed by two hexadecimal digits (0–9 or A–F) representing the byte's numeric value. For example, an ASCII form feed character (decimal value 12) can be represented by "=0C", and an ASCII equal sign (decimal value 61) must be represented by "=3D". All characters except printable ASCII characters or end of line characters must be encoded in this fashion.
It's possible I'm overlooking things... But trying another SMTP server.
Ohhhh OK I missed the line ending. Have you tried encoding the . as =2E? . on a line on it's own means "end of the message" in SMTP, it's possible that the server is dumb and is eating it while trying to parse for that.
@Lucio It's because the column is a DATETIME and you are just passing the date portion. The times don't match.
@DaveRandom Crappy server Dave mate, used Gmail SMTP, works very good. Thank you for your help.
@webarto Indeed, but I'm will to bet that that ^^ is the reason, you should factor it in to your qp_encode() routine
22:41
@DaveRandom I'll try that mate.
@webarto Why are you rolling your own SMTP connector anyway?
@DaveRandom Nay, using framework.zend.com/manual/1.12/en/zend.mail.html, I already "solved" some issues, for example, parsing email sent from Word (wtf, right), but I cba to report... (another issue with quoted printable)
            try {
              $this->message = new Zend_Mail_Message(array( 'raw' => $this->stdin));

              // Attempt to access the header to ensure proper parsing was done
              $this->message->from;

            } catch (Zend_Mail_Exception $e) {
              // Attempt to fix parsing errors be adding proper CRLF.
              // Zend_Mime_Decode uses iconv_mime_decode_headers in
              // ICONV_MIME_DECODE_CONTINUE_ON_ERROR mode which fails to parse
              // certain email messages in quoted printable format. Namely headers
I don't understand why any framework would ever require you to go anywhere near manually encoding...
anyone knows a comic book which fits these keywords ? (and no , google will not help)
> "graphic novel" bike "near future" "bald cop" "fake eye" skyscraper "blow up helicopter"
22:48
Ahhh kk, although also
@tereško You just asked that in the JavaScript room
so fucking what ?
@webarto the one i am looking for has no "superheroes"
basically what i am looking for is a cross between Akira and Sin City
.. i wonder .. are there any comic shops in LV .. i could go browse there
23:00
f* logic
@tereško Maybe ask on SciFi or something?
23:14
@tereško or you can try comixology
tnx .. will try
@tereško there is also a few dedicated comic wikis which you could try
i originally tried to start with tvtropes .. it fell flat =/

« first day (838 days earlier)      last day (4335 days later) »