« first day (1499 days earlier)      last day (3440 days later) » 
00:00 - 22:0022:00 - 00:00

12:01 AM
Noight room
 
nn
 
12:55 AM
-1
Q: Encrypting and Decrypting with password_hash and SHA256

TrudaI have two scripts, a verify.php and a register.php. On my registration page I use this.. $salt = hash('sha256', uniqid(mt_rand(), true) . $email); $storedHash = $salt . $password; for ( $i = 0; $i < 50000; $i ++ ) { $storedHash = hash('sha256', $sto...

 
1:05 AM
"Dear Lord, Please Grant Me The Ability To Punch People In The Face Over Standard TCP/IP.png"
7
 
1:22 AM
@ircmaxell Why do they bother mentioning password_hash if they're not using it?
@ircmaxell Just tell them to use password_hash instead of SHA256 :p
 
1:42 AM
Anyone know who "iflickle" is? Other than someone who spams on Github.
 
2:32 AM
yo
 
Good Morning
 
2:53 AM
@ircmaxell So… did Google kill off 20% time last year or just restrict what you can do with it? Or change it altogether?
I'm asking because I remembered hearing about it but never saw any concrete articles ^^
 
3:07 AM
Nope, recki was one of my 20% projects
 
@ircmaxell As I understand it, 20% time isn't gone, you just need to get it approved now, right?
 
@ircmaxell was? Past-tense?
 
g'night
 
Good night.
 
amazon s3 anyone?
 
 
3 hours later…
6:01 AM
Morning
 
Morning ^^ (It's night for me)
 
^^ Same
 
Oh, so you were just following UGT.
I thought we were both roughly in the same area of the world, so I was confused.
 
We are, I think a timezone off
Blah, I'mma afk
 
6:26 AM
morningz
 
7:12 AM
Why is it that using debug_backtrace() feels so dirty when acquiring a previous instance of an object?
The alternative: Passing around the parent instance to all child objects - and that just seems archaic... am I wrong?
 
Cause it is dirty?
 
@nikita2206 Yeah... it is. Perhaps it's just late and I can't think of a better solution. My morals as a PHP developer have me at a block in my progress. Any ideas?
 
8:03 AM
@rdlowrey is my wrist ...
 
 
2 hours later…
10:00 AM
morning
 
10:46 AM
Haven't managed to make much progress on the moodle login since last night :/
Anyone got any ideas?
0
Q: cURL works from Terminal, but not from PHP

Raghav SoodI'm running into a rather strange issue. I'm trying to log into a remote moodle install using curl from PHP. I have a curl command, which works perfectly in the Terminal. When I translate the same thing into PHP, it works, but it just doesn't login. The exact same value which successfully logi...

 
@RaghavSood "Doesn't work" Do you mean it sits around the house all day eating cheatos?
 
I wish. At least I'd have some company then :P
 
The curl info is saying you're getting a 200 back ....what behaviour are you expecting that you aren't seeing?
 
When I run it from the terminal, I get a tiny response telling me to redirect to the index page
When I login via php with the same data, I get the entire login page back
 
Trying ensuring that you have every header set exactly the same - it looks like Referer isn't set in the PHP version.
 
10:52 AM
This is the output from the command line
 
It could be some dumb anti-hacking mechanism.
 
Where as the PHP version just sends this entire page back
Huh. Referrer isn't set. Let me try with that
Adding the referrer doesn't seem to have helped
 
Er - wtf. That site doesn't use SSL for it's login page....If you want to debug it, you should install wireshark, compare the requests and see the exact differences between them, and then eliminate the differences.
 
That's my school's website :P
Forget SSL. Passwords are sent in plaintext
 
That is what he said.
=]
 
11:05 AM
Haha not like that. As in, they aren't even hashed
 
One requires a min reputation to talk in here?
 
12:14 PM
yes 20 rep
 
Mornin
 
Morning @Ihsan
 
Sunday. So silent! :D
 
[= yea
 
12:33 PM
See you later all. Have a nice day.
 
Later @Ihsan
 
12:45 PM
Morning
 
Morning @Fabor, enjoyed your weekend?
 
Meh. Been suffering a toothache for the past couple of days.
 
Yea, I read. How is it going?
(btw. I got 100% fear of dentists, gets me shit scared)
 
ATm not too bad but it's still aching. I'm just really hoping it's normal teething. I have surgery on Tuesday for my right tibia. Been waiting months to have it and if this teething is abnormal and affects me having that surgery I am going to be pretty depressed :(
How's your weekend been and the job search?
 
@RaghavSood still here?
mornings
 
1:01 PM
@Fabor, Best hopes. The job search is good, passed round 1, did a 210 q personality test couple days ago, and on Wednesday I am taking the "intelligens test".
morning @DaveRandom
 
Morning
 
MornHaa. How's the head?
 
yo dawg, I heard you like drinking so I gave you a hangover
 
MornDom
@RonniSkansing That the magento on?
 
@DaveRandom neh I had a good breakfast so all is ok
 
1:03 PM
@Fabor yea, they run multiple webshops, some of it is on magento.
 
The fact I opened a new beer also helps :P
 
atleast it isnt woocommerce =]
 
Ah fair enough. I always advise working at a place who runs their own stuff rather than having clients.
 
@PeeHaa Yeh, always a good tactic
I need to go get some breakfast actually, brb
 
Well.. Gonna take a bath.. I stink.. laters.
 
1:05 PM
@DaveRandom Enjoy
 
@NikiC Happy Birthday :)
25
 
1:29 PM
-9
Q: Could somebody tell me about some good and reliable sources for career counselling and planning in Ahmedabad?

user275768I would like to add that I have already finished my post-graduation and also worked at a certain place in between. No offensive statements or trolling please, only genuine responses.

Could someone kill this please?
 
@DaveRandom Am now
 
@RaghavSood Can you provide some form of credentials that should work? I want to see exactly what the difference between a browser, cmd line curl + PHP curl is in Wireshark
Or if you could provide 3 packet caps that would also be good, but that would still just have the credentials in so... yeh
 
It's my school ID, so I really don't want to be giving out the username and password over the internet :P
 
@RaghavSood Yeh fair enough... failing that can you get the full ascii request/response chain from both cmd line and PHP and gist it or sth (you can blank out the credentials in that)
 
Yeah, should be able to do that in some time. Not on my laptop at the moment
 
1:45 PM
@RaghavSood np, ping me whenever (and add it to your q as well) :-)
 
is it a problem to use htmlentities and htmlspecialchars methods for a string?
 
@MikeM. Use one or the other, not both
Usually you want htmlspecialchars()
 
I see many people going against each other
like 1 say htmlspecialchars() is better than htmlentities() and then there are the other people saying the opposite -.-
 
generally what you want is the minimal escaping for a given scenario to keep the size of the content down, that's what it comes down to
 
@SecondRikudo Could somebody tell me about some good and reliable sources for PHP-induced Post-Traumatic Stress Disorder counselling and planning in Aberdeen?
 
1:51 PM
@AndreaFaulds haskell
 
6
A: htmlspecialchars vs htmlentities when concerned with XSS

Theodore R. Smithhtmlspecialchars() will NOT protect you against UTF-7 XSS exploits, that still plague Internet Explorer, even in IE 9: http://securethoughts.com/2009/05/exploiting-ie8-utf-7-xss-vulnerability-using-local-redirection/ For instance: <?php $_GET['password'] = 'asdf&ddddd"fancy˝quotes˝'; echo html...

 
You'll love php after that
 
like that this confuses me with the other answers xD
 
@FlorianMargaine No, Haskell just made me hate PHP more :p
Haskell is useless, but damn if it isn't a beautiful language
 
Try lisp
 
1:53 PM
))))))))))))))))))))))
 
Lisp destroys your paren keys, but it's still beautiful
 
(It's my favorite language, personally)
 
I should learn Scheme.
All the Lisps I've learned up to now have been ones I made myself, toy lisps.
 
@MikeM. The problem there is that neither function is for sanitising user input or handling encoding problems. It is probably pretty rare that you take some user input and display directly back to the user without going through some form of validation/intermediate storage (e.g. database)
 
Yeah... I meant common lisp
 
1:54 PM
Both functions are for handling problems with display, not problems with sanitisation.
 
Ewwww, Common Lisp sucks
 
nonsense, lisp is nobody's favourite anything ... unless you are saying it's your favourite of the educational languages, like asphyxiation is my favourite form of long drawn out and painful death, in which case it doesn't mean anything to say that ...
 
@JoeWatkins No, Lisp is a good language
 
@DaveRandom So with other words just ignore it?
 
Nope, I meant Common Lisp is my favorite language to build stuff :P
 
1:55 PM
IIRC Reddit was originally written in Common Lisp
"A website project to fill the needs of a nearly SPA"
Did you mean *nearby*?
 
good languages are the ones we use, until you said reddit was written in lisp, I've never heard of any major project using lisp as it's primary language ...
 
@MikeM. Verify that the input data is sane within the domain you expect it to be. For example, if you are expecting characters outside basic ascii, it's a good idea to use UTF-8. mb_check_encoding() can be used to validate that the data really is what you are expecting.
 
@AndreaFaulds somewhere around my home :)
it's an animal shelter...
 
@FlorianMargaine Nearby, then.
 
oh, right
ty
I did mean nearby :)
 
1:59 PM
:-)
 
:-)
If I add a - to my smileys, I sound like @ircmaxell
Compare:
:) <-- not very Anthony Ferrara
 
@JoeWatkins well... see repo :P
 
:-) <-- really Anthony Ferrara
2
(star that last one just to confuse Anthony when he's next about :p)
 
I think ":)" and ":-)" have different meanings :s
 
2:01 PM
One is for people who hate noses, the other is for normal people :-P
 
:-) seems older and friendlier
 
(:-) is more well rounded
 
@RaghavSood (:-) has no smile
 
(:-)3 is Peter Griffin
2
 
(:-)) gets a double chin when he smiles
 
2:03 PM
:-| is just the best -.-
[̲̅$̲̅(̲̅ ͡° ͜ʖ ͡°̲̅)̲̅$̲̅] <= there is lenny!
would it be usefull to create some kind of rainbow table which saves:
id
loginkey
salt

and the users table contains
id
r_id
password
...........
 
why do you want to do that?
 
so the salt and loginkey are not saved in the users table but the r_id is referenced to it.
 
what does it bring?
 
that the keys are serperated from the user table so the user table.
 
you told me what to do, not what it brings
 
2:12 PM
@MikeM. No that makes no sense whatsoever
 
why do you want to do that? for security?
 
I guess the opposite :)
 
I always liked =] [= >8] etc
 
normalization is there to avoid duplication
 
@FlorianMargaine for mistakes yes.
 
2:14 PM
what kind of mistake?
 
Let's say the site holder is manually changing some user information in the database like regip, I understand some sites want to keep their staffs IP out there.
then they accidentally changed the salt key because of a stupid or even drunk mistake....
 
5 mins ago, by PeeHaa
@MikeM. No that makes no sense whatsoever
 
You cannot code against stupidity
 
@PeeHaa Oh sorry I overlooked that.
@DaveRandom That's true
lol
someone had to much time xD
check his assign_rand_value()
 
2:30 PM
@MikeM. how would you do it?
 
I used a worse way I think
 
(just the function, or the genkey function)
 
substr(str_shuffle(str_repeat('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvw‌​xyz0123456789',100)),0,$num);
I used that before.
 
@MikeM. is that secure?
 
probably not.
 
2:33 PM
So why are/where you doing it? =]
 
Because thats what I did when I was starting in php
xD
Now I have no idea how I'd do it as there are so many damn things related to security which confuses me as hell
 
security is a wide subject
and hard
 
@MikeM. RandomLib
 
argh
why do some people use: $salt = mcrypt_create_iv(22, MCRYPT_DEV_URANDOM);
 
2:49 PM
@MikeM. why not?
 
wait
I am derping
argh
if you use the password_hash function how would you get out the salt key?
 
Might be someone wants to generate a salt instead of having password_hash generate the salt randomly, why someone would do that, I do not know, but why worry about it, if it is still to advanced a subject? I would probably start reading about encryption/salt/etc instead of picking out people code.
 
does it return an array like array(password => "hashed", salt => "saltkey");
 
I do not know, I know very little about it. I let the experts rule and pray for the best. If I wanted it differently I would spend vast hours trying to learn it by reading and trying out stuff. Sometimes a minimal understanding does not come from a couple qa's
 
Just try it out
 
2:56 PM
I am just curious how would you be able to verify a password if you don't have a salt key but only the hash? I assume the hash is all you get returned from the password_hash()
 
@MikeM. The salt is part of the hash
 
oh so the password_verify pretty much takes out the salt out of the hashed password and check if it's correct?
 
@MikeM. sure, I am also very curious by nature.. but try reversing some of the question you ask yourself. Because doing so might help you to realize that a better understanding of the parts that give the sum is needed
For example in this case, what is salt, what is hash, how does hashing work et c etc
 
3:48 PM
...
Undefined symbols for architecture x86_64:
  "_var_dump", referenced from:
      _zend_scan_escape_string in zend_language_scanner.o
     (maybe you meant: _php_var_dump, _zif_var_dump )
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [sapi/cli/php] Error 1
...this is what using PHP does to you
 
4:16 PM
Hey, guess what I did! ^^ github.com/TazeTSchnitzel/php-src/compare/… <-- Unicode escape sequences ^^
 
Good Job I guess
 
@JoeWatkins @Ja͢ck ^
 
 
1 hour later…
5:34 PM
The hour silence got destroyed :)
 
5:58 PM
Achieved: first 50 followers on twitter…
 
6:08 PM
@bwoebi You only have 49.
 
@AndreaFaulds I had 50 at the time I posted here...
 
user895378
5 hours ago, by Joe Watkins
@NikiC Happy Birthday :)
 
user895378
^ @NikiC happy bday!
 
user895378
And I just read up on the regex routing issue. It's a tough problem. I originally had only very limited wildcard matching so it wasn't an issue at that point.
 
@AndreaFaulds btw. great idea to introduce \u syntax in PHP.
 
user895378
6:16 PM
For my use cases adding the allowed methods directly into the pattern to match isn't an issue because long-running process means I get to reuse the compiled regex.
 
user895378
But yeah, you need to know what methods are actually allowed for a given resource (Allow: GET, HEAD, ZANZIBAR) if you want to return a 405.
 
@bwoebi :)
I decided on the \u{} style because just \uxxxx like most other languages stops you using stuff outside the Basic Multilingual Plane, and isn't clearly delimeted
 
@AndreaFaulds but why \u{x} and not just \ux ?
 
The only real arguments I can see against adding this to PHP are 1) BC break for some code - but this would be for PHP 7, and 2) Strings aren't Unicode, they're byte strings - to which I say, yes, but we assume things are UTF-8 in most places
@bwoebi Well, it's still not clearly delimited, which is bad
I can't do "\u202efoo" if we allow variable-length codepoint numbers, because it'd be interpreted as U+202EF + "oo" not U+202E + "foo"
Furthermore, people expect \u to be followed by only 4 digits, no more, no less, as that's what other languages do.
 
@AndreaFaulds then I'd propose just \{x}
 
6:24 PM
@bwoebi That's not obviously Unicode... and would probably break things (regex?).
 
ok, you're right
 
What's the routing issue? /c @rdlowrey
 
user895378
@nikita2206 this
 
6:43 PM
Who wants Unicode escape sequences for #PHP? https://github.com/TazeTSchnitzel/php-src/compare/php:master...TazeTSchnitzel:unicodeEscape - Means you can do "\u{1F602}" to get 😂
away, eats
 
hello
Any recommendations for a template library?
 
@rdlowrey Hey man, I am getting Warning: strtolower() expects parameter 1 to be string, object given ... Provider.php:74, when I call this $provider->make(ACL, array('c' => $controller)); Am I doing it wrong?
ah i see my problem
But isn't there an option to just send the dependency to that parameter
 
It's wonderful how cheap external hdd's are nowadays
54$ for 1TB I remember when I had to buy a 500gb external hdd for 100+eur a few years ago.
 
nvm ignroe me, found it
@MikeM. I remember buying my 147gb HDD for over $50 which was a few years ago lol
148gb * sorry
 
damn pizza is sooo good [=
 
7:30 PM
Hi pretty people
 
@JoeWatkins @PeeHaa @rdlowrey Thanks :)
 
Happy happy birthday
<elephpant greetings card>
 
Haooy bday @NikiC (=
 
I didn't know programmers were pretty...
 
7:41 PM
@HamZa you obviously don't @rdlowrey much ...
@NikiC you forgot $wisdom++;
 
@JoeWatkins I do workout but only bodyweight. So I don't go to the gym basically :P
 
@NikiC yeah, happy birthday :-)
 
8:06 PM
I had a file a.php in my php-src root (for testing) … and I really wondered by bug67436 tests failed... Fucking include path taking precedence over script path.
 
0
A: Working with Threads using Apache and PHP

Joe WatkinsThe mere fact that it is possible to do something, says nothing whatever about whether it is appropriate. The facts are, that the threading model used by pthreads+PHP is 1:1, that is to say one user thread to one kernel thread. To deploy this model at the frontend of a web application inside of...

I said a thing ...
and now I'm going to watch a film about apes ... nn all
 
@bwoebi Hey, does the fix for constant array default params exist in the 5.6 branch?
 
@AndreaFaulds I just pushed it there.
Now working on merging into master.
Conflicts in each file.
 
And as usual I've forgotten to attach a test and a NEWS entry.
 
8:16 PM
@bwoebi I was about to say...
 
Yeah, let me first merge into master and then I'll do.
@AndreaFaulds but the bug is fixed... correct?
 
@bwoebi I'll try it out and see ^^
$ sapi/cli/php -r 'const FOO = ['bar' => 'qux']; function foobiz(array $foo = FOO) { var_dump($foo); } foobiz(); foobiz([]);'
array(1) {
  ["bar"]=>
  string(3) "qux"
}
array(0) {
}
@bwoebi it works :)
 
great
 
8:36 PM
Damnit @Andrea … I want to concentrate and fix the things not laugh too much :-D
 
@bwoebi :3
(I also really need to concentrate on more important things, damnit)
 
Hello
Do you know does SQLite support DATETIME data type?
 
What do you know. There is a page devoted to this
 
Thank you, @PeeHaa
 
E_TOO_SLOW_FOR_RTFM :*(
 
8:43 PM
Wait, SQLite doesn't enforce types? Huh
I must have misread that page before
Ooh, SQLite does Type Affinity selection based on substrings... so I could make a column with type HINT and it'd make it an int
 
There is so little info on using the Photobucket API with PHP..
 
Imitation Game is a thumbs up. Go watch.
 
Wait what? It's @NikiC's birthday today? It's my birthday as well!
:O
 
8:58 PM
not a php question, but is this chat only available in the browser? what does it run on the backend (I'd prefer a different way to connect)
 
You mean like IRC?
I believe it's only available via a browser.
 
Happy birthday @AmalMurali
11
 
Thank you!
 
Your welcome
 
@amal IRC would be perfect, xmpp would be good too, I've found a few old posts in meta about connecting with IRC (some kind of local proxy) but nothing new :(
 
9:02 PM
this chat is php + js I believe so...
 
161
Q: Offer an XMPP method for chat

Greg HewgillThis is a request for the SO chat system to have an XMPP interface. The whole idea of a chat system is to bring people together, and a key way of doing that is to allow people to access the system using more than one method. Right now there's a web interface, but it's limited to being a web inte...

 
i believe everything here is asp.net in the backend
 
Then there's this: github.com/ghewgill/soirc
@Jonathan: For IRC, try that ^
 
@ama
lol
 
@nikita2206 asp.net mvc then.
 
9:04 PM
think it links to the same, ill have a go :)
 
I am going to sleep
it's 10:05 PM argh
good night everybody.
 
I am, too. It's 2.36 AM
AAAAAAAARGH.
 
its only 21:08 here..
 
Happy bday @AmalMurali
 
@DaveRandom You around?
 
9:12 PM
yo
 
Here's the verbose output from the Terminal for my cURL: pastebin.com/VyVGX2RU
Heya :D
 
Cool, and PHP?
 
Setting curl to verbose doesn't seem to be having any affect on the server :/
 
@RaghavSood $fp = fopen('/tmp/trace.txt', 'w'); curl_setopt($ch, CURLOPT_VERBOSE, true); curl_setopt($ch, CURLOPT_STDERR, $fp);
 
Ahh. Did I mention I'm an idiot?
 
9:18 PM
> X-Powered-By: PHP/5.3.2-1ubuntu4.21
4
 
anyone here familiar with amazon s3
 
sweet jesus
@RaghavSood Nah, cURL is just insane
 
School IT team isn't exactly star quality
 
It's worth looking into using a better HTTP client, btw, there are plenty available
I know you're a Java guy, there are some much more Java-like things available
and some good ones as well
:-P
 
trying to upload file using php and S3. Keep getting ---Warning: S3::inputFile(): Unable to open input file:
 
9:21 PM
PHP's actually the only language I have a certification in :P But that was years ago. Mostly been in Java/asm/C++ the past few years
 
@RaghavSood Just keep in mind that cURL is one of the worst APIs that PHP has
 
Not judging PHP by it's cURL :)
Been using PHP on and off for a lot of my backends
Here's the server cURL: pastebin.com/Vh0UE6F1
 
@RaghavSood read: I judge it by all the other terrible things
 
A lot of the headers seem to dissappear :/
 
It's pretty obvious something's majorly wrong there
just a moment, let me re-read your codez
 
9:30 PM
PHP/5.3.2-1ubuntu4.21 with Suhosin-Patch wow one of the school guys actually figured out how to patch stuff o.O
 
Nah, that'll be apt-get probably
Give me a couple of mins, struggling to reproduce :-S
 
The code's live on a site, if that helps
The login API is at shriteq.org/newcms/api/login
username goes in a POST labelled username, password in one labelled password
 
9:52 PM
@RaghavSood cannot reproduce. There can be some weird things with incompatible options and things that must be set in a certain order with curl, so can you try replacing your curl_init/curl_setopt_array with:
$creq = curl_init('http://moodle.tsrs.org/login/index.php');

curl_setopt($creq, CURLOPT_RETURNTRANSFER, true);
curl_setopt($creq, CURLOPT_FOLLOWLOCATION, false);

curl_setopt($creq, CURLOPT_POST, true);
curl_setopt($creq, CURLOPT_POSTFIELDS, $data);
curl_setopt($creq, CURLOPT_HTTPHEADER, $headers);
Stupid markdown
That should be the minimal options you need to make it work
 
Cookies?
 
Should be handled internally, unless you need to keep hold of them after the login process
otherwise just set COOKIEFILE/COOKIEJAR to any valid file system path, the same path for both options
 
Well... It got worse, if anything
 
If you're able to vote and haven't yet done so, please consider it for the Safe Casting Functions RFC: wiki.php.net/rfc/safe_cast#vote
 
Curlinfo's given up on headers altogether now: pastebin.com/PaWVH5en
 
9:59 PM
If 5 more people voted Yes, it might pass. On the other hand, if 5 more people voted No, it'd be even less likely to pass :p
 
00:00 - 22:0022:00 - 00:00

« first day (1499 days earlier)      last day (3440 days later) »