« first day (2498 days earlier)      last day (2676 days later) » 

16:00
The whole logic behind the code is when user visits
domain.tld/page_that_requires_login.php
he gets redirected to domain.tld/login.php?forward=page_that_requires_login.php
@Tiffany safecurves.cr.yp.to may provide you with some further reading but I am going nowhere near that particular rabbit hole
So? You don't need a full absolute url for that
oh boy
Even if you need it because you are running several tlds you should always whitelist it
OK, I may have improperly copied my code for the sake of asking the question, here is the real code:
        if(isset($_GET["forward"])) {
            header("Location: " . DOMAIN . $_GET["forward"]);
        }
where DOMAIN is a constant equal to my domain
16:02
@Danack if you can provide me with a URL where I can throw some requests at it I don't mind seeing if I can figure out what the difference is, but if it's a problem that only happens "sometimes" then I might not be able to repro anyway
@DaveRandom sent you it via twatter, and yeah....it's currently "working".
@sweg_yolo_69 I feel like it's vulnerable to XSS
but don't ask me how
My instinct is that it's something stupid with google cloud engine.
It's not. Not in those specific lines :)
And header injection is "prevented" using the header() function
@Danack possibly, but if it's something that seemingly comes and goes... what happens if you take the geoloc database offline (however that works)?
just wondering if it could be that the db is going away that's what causes the problem
oh mind you that wouldn't explain the curl thing
16:04
@Leigh it's on the ml?
No....the code is designed to work regardless of whether the lookup suceeds or fails.
designed to != does :-P
but yeh, fine
We were seeing the same thing when the geo lookup was using the IP address of the load balancer...
logically if it happens to a browser but not to curl from the same machine, it must be some property of the actual request
md5 is bad, right?
16:10
depends what you are using it for
it's generally not good for anything in crypto though
in the example, it's used to make sure a "form submission is valid and intentional"
creating a token
md5 doesn't matter
How it is being generated does
As in the input of md5
@NikiC I didn't know if that was the proposed patch or "here's an idea"
I'll leave you to it then
example uses
    $_SESSION['token'] = md5(uniqid(mt_rand(), true));
That's somewhat weird yeah
16:13
it says it's protection for CSRF
probably use random_bytes().
That ^
/but I don't give security advice.
In fact, don't let @Leigh see that.
uniqid is worse than useless
And mt_rand is well mt_rand...
you just need something that's not guessable for a csrf token
16:14
I'll write in random_bytes() then, unless there's something better
Nope. random_bytes it is
you don't actually need secure randomness for it
@Tiffany in PHP7, that is the correct approach
if you require the same format as md5, bin2hex(random_bytes(16));
^
you obviously do need it to be printable for a csrf token
thanks all
16:18
/me goes home
anybody good with regex?
(?:[^[]|[(?!/?indent])|(?R))
I am working on this, but I wont complete it today, maybe tomorrow
(?: [^[] | [ (?! /?indent] ) | (?R) )
(?: A | B | (?R) ), lets say
how does the (?R) part work in this example?
Programming is about problem solving. What you are currently involved in is problem creation.
/me actually goes home
I have not learned the regex yet, I need to get past it, finish something and then I would do the regex part (the whole edu)
16:23
@AaronSmith Several people already pointed you to resources
Throughout the day
read them
lets solve it then :)
No you solve it
not today
I am too tired
So why should be help you?
and like I said, I have not been learning this yet, it does not make sense, it is like fixing a car before knowing how to do it and then learning it
16:24
So learn it instead of vamping the entire day
I understand that, but I want to get past some other things first
I've been figuring out what I was not understanding and I got like 3-4 levels "deep"
i have a serious speculation about this guy
and I got to this "gem" :)
I will come back to it tomorrow I guess, or keep trying
that trying creates a progress too
it will be easier the next day
could be match A, if this does not match go to B, and if B was matching, mirror that; and if A was matching - mirror the A and skip the B?
this is an advanced regex example, as far as I was looking, so it is not something like "[^a]" that I am asking about
@Leigh it was a proposed patch minus the testing
it is not really directly explained how "A | B | (?P)" can "behave"
16:31
If you have time to implement some good tests to make sure this doesn't happen again, please feel free
@NikiC could you please take a look at the question stackoverflow.com/questions/45756859/…
am I on the right path with that or not really?
@JAamish You should always use zval_ptr_dtor unless you know what you're doing
I'm trying to understand more on when to call zval_dtor and all the examples in the php sources call zval_ptr_dtor. But even if I call the ptr_dtor, it still crashes
@DaveRandom Think I've figured it out.....Varnish uses req.url as the cache key to store the response under. For random ass reasons, the guy who implemented the geo redirect was updating that to be the redirect location, as well as setting resp.http.Location
16:33
@JAamish you still haven't defined what "crashes" actually is... like does it throw an error message, does it stop running altogether?
@JAamish If it crashes the error is probably somewhere else
In any case, you can basically forget about zval_dtor, it's a PHP5-ism that's no longer relevant
I'm calling a class' function. It returns a class variable back (array). When I do a ptr_dtor, it seems I destroy that array that is from the php application
Got it - I will use zval_ptr_dtor
@Tiffany It crashes altogether
That, interacting with browsers caching the 301, and varnish emptying its cache would explain the apparently insane behaviour we were seeing.
but still, will zval_ptr_dtor destroy the array from the class variable
@JAamish It will only destroy it if it's not used elsewhere
16:38
what happens is - it is an action array from the framework. So after registration of the user, when a redirection from the URL happens, it seems that the array is destroyed and then the redirection of the URL fails.
what will happen if I avoid calling the zval_ptr_dtor
in this case. Will there be a memory leak
The problem is most likely somewhere else
That code (with zval_ptr_dtor) looks correct to me
But as a rule, should I call the zval_ptr_dtor on the return value
yeah
is it a must (to avoid memory leaks)
ok
Thanks a lot! I will look into it further.
I assume that you're not actually using the return value, right?
16:41
I'm checking if the value is a string, if so I use it. Since it is an array, I don't use it. But in the last step I call dtor
ok, that sounds fine
Thanks @NikiC.
@DaveRandom s/Alcohol/MethylAlcohol :D
That moment you see there is something terrible wrong with your SQL query. ><
17:12
@DaveRandom I think the innerjoin is not correct, I grab the wrong ID imo.
kopy.io/p3eBT . I think I have to refer my 'dishes' table which contains ( id, name, price ) in a way to select the right ID now it feels like it's grabbing the wrong ID. :s
@Trowski Are you on holidays or just forgot to open IRC? :P
@kelunik Huh, program is open, it just didn't connect.
Anonymous
17:51
eh @tereško thanks for ruining GoT for me. I finally had the time to watch it but now I can't :/
Anonymous
I should have saved Rick and Morty for this weekend
@samayo How did he ruin it?
Anonymous
yesterday, by tereško
@samayo here is the only spoiler you need: major characters die
Anonymous
Yup, he did that.
@samayo It's GoT, so major characters dying is hardly a spoiler
Anonymous
18:02
Well it kinda is. Now I have to watch it knowing all the major characters will die at some point. It's like waiting for them to die.
Anonymous
The surprise element is already gone
you would have figured it out yourself by episode 3
Anonymous
Ah, great more spoilers ... keep it coming
@samayo It's not like they all die
... yet
18:05
And you know, just because they die doesn't mean they stay dead :P
Aug 14 at 0:22, by Danack
I don't watch tv shows while they're being aired, to avoid wanting to get up at 3am to watch the new ones, or to avoid the series going to shit and being a complete waste of time - hello Lost.
That might still happen.
@Danack Oh god lost
That was terribad
Also, Flashforward
Oh god flashforward
Fuck
Maake it stoooop
18:16
lol so true
18:30
@Saitama wtf do you keep in your fridge?
someone uses Very Old Browser and accesses Modern Website, Very Old Browser does not have support for the cipher suites that Modern Website uses. what happens? does the page not load? is the connection insecure?
wow that's a terrible question
hopefully that's clearer
@Tiffany they should either negotiate a secure connection, or not. If not, the page won't load.
if they don't share a common 'cipher suite' they won't be able to negotiate how to communicate securely.
@Danack that makes sense
trying to decide which cipher suites to use makes my head hurt
18:48
@Dereleased ?
slashdot.. there's a site I've not seen in a very long time
@DaveRandom lol
19:24
@PaulCrovella Reminds me of this comic gem. Which seriously makes me feel old
I really should read more warhammer lore: youtube.com/watch?v=GtsvUBW-MMc (the skaven seem addorable)
19:43
test
> Is it not true that each superpower has enough nuclear weapons to kill all members of mankind several times over? Yes. And the same is true of kitchen knives.
@tereško What are you babbling about?
@Allenph I am waiting for GOG to finish installing and decided to find one quote, that I vaguely remember regarding "overkill"
came across that quote instead
@Tiffany That reminds me of that story I told you guys.
GOG?
19:51
good old games
I'm guessing an application launcher like Steam or Battle.net is (yes I know they changed the name to Blizzard or whatever, I'm still calling it Battle.net)
Battle.net forever and ever.
it's such a better name
I remember getting absolutely owned the first time I played Warcraft III online.
Warcraft 2 for me
god, that was 20 years ago
I was too late for that.
But I played Warcraft II.
19:55
Warcraft 2 seemed like a game of chess with magic, and which happened to be the only difference in the game -- different spells
I played so many custom games of Warcraft 3. I tried learning how to play it as a strategy game, even had a friend that was trying to help me, and I basically gave up, custom games were more fun, imo
RTS Warcraft 3 was the bomb.
I don't know how you could blaspheme against your own kind like that.
I'm not very good at strategy, and custom games were instant gratification
-1
A: How to do two SELECTs with GROUP BY in a PHP MVC framework?

Arun SCodeigniter is good choice to start understanding mvc for php devs. Once you are comfortable with it you can move into laravel, zend, yii etc.

for fuck sake
@tereško xD
> Yeah, and also why you don't use an existing bullet proof framework, instead of creating your own?
-_-
20:10
"zend is dead" is a bit harsh :B
but is it wrong?
people working on it seem reasonable programmers and they are improving it from what i heard
symfony is also a mess, i heard, but they are also improving it, favoring solid principles and stuff
@tereško Are you saying that if you have used CodeIgniter once you will never be able to understand MVC?
Ah nevermind, it's tautological if you consider that nobody understands MVC anyway.
i have no news about yii and codeigniter
@NikiC I think the question means MySQL Very Complicated
20:12
but again zend could end up being decent in the next versions
@NikiC no, but if you "learn mvc" from codeigniter, it's a good bet, that you have been scarred for life
@tereško *scarred
symfony in particular will be (is being) converted into smaller packages that i might even consider to use
could also be frightened
ok, no, serious question: should I play Morrowind or Xenonauts ?
20:15
Morrowind
I'm leaning towards Morrowind
Xenonauts
how should I user data like read articles for easy access
can you rephrase that?
I understand the words that you're saying, but I do not understand them in the order that you've used them.
access articles data easy for how I like read should user
alphabetical order almost works
20:28
:P
Maybe reverse alphabetical ?
@tereško morrowind.
Do you even user data?
@Danack @DaveRandom Didn't read the full discussion you had earlier today, but 301 redirects are cachable by default, however, browsers should also respect any caching headers you apply, so you can just set a max-age and it's going to be fine (never tested that, but it should work).
@kelunik I think it was the fact that the guy who implemented it was updating the req.url parameter - which alters the cache key that varnish stores the response under.
20:58
@Allenph I reminded them and reforwarded it days ago, haven't heard anything =/
21:18
!!wotd
confabulate: to converse informally; chat.
21:31
apart call_user_func, $foo() and named_function() are there other "function call" syntaxes?
@WesStark I've been demonstrating that recently
why not take it further? 3v4l.org/Z4f8D
That having been said, What we've both linked is essentially $foo(), but 7 doesn't make us do (as much) useless variable indirection anymore
new ("My" . "Class" . $name)()
this doesn't work tho
maybe i did parentheses wrong?
No, classes don't accept that syntax
i like it, not that i'm gonna abuse it
actually maybe i don't like it
i kinda like this type of liberty, but it's not really justified
ugh, meant to correct to "No, classes new doesn't accept that syntax" but the internet went out here for a minute and now it's too old to edit
21:46
@WesStark just assign it to a variable first.
@Dereleased You're never to old for toe dit.
user924016
anyone seen this crystal lang?
@Danack tx
@Danack i don't do that kind of stuff :B
and i wasn't suggesting we should have it
22:01
@WesStark like anyone's gonna believe you :P
i really don't. i don't even use callable these days, no functions or classes as string
@RonniSkansing already has 464 issues
105 are tagged as bugs
22:41
Ooh. There's a proposal to add <=> to C++… and it cites PHP's <=> as precedent! I've indirectly influenced C++ :D http://open-std.org/JTC1/SC22/WG21/docs/papers/2017/p0515r0.pdf
ahahaha
are there other things that other languages have adopted looking at php? :D
All of Hack?
that doesn't count :P
 
1 hour later…
23:59
How on earth can this be an error ?

« first day (2498 days earlier)      last day (2676 days later) »