« first day (2312 days earlier)      last day (2633 days later) » 

@DaveRandom Well, you're not taking into account mod_vhost_alias
;)
Apache httpd can be a scarry place.
 
Hey all.
 
apache is a big ball of mud
 
<?php

$con = mysqli_connect('localhost','XXX','XXX','XXX');
if(!$con) exit('Could not connect: ' . mysqli_error($con));

$username = strval($_GET['username']);

$sql = "SELECT * FROM $username";
$results = $con->query($sql);

$data = new stdClass;

while($result = $results->fetch_object()){
    $day = $result->day;
    $data->{$day} = $result;
}

exit(json_encode($data));

mysqli_close($con);
?>
 
@Sherif I remember
 
10:02 AM
Can anyone pick out any immediate syntax errors here? I'm getting an internal server error.
I assume its syntax, anyway.
 
Anonymous
!!canon sqli
 
2785
Q: How can I prevent SQL injection in PHP?

Andrew G. JohnsonIf user input is inserted without modification into an SQL query, then the application becomes vulnerable to SQL injection, like in the following example: $unsafe_variable = $_POST['user_input']; mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')"); That's because the us...

 
Yes Jeeves
I know
 
@DaveRandom Try maintaining 4K apache httpd servers for a few years. You'll really regret your life.
 
Anonymous
@Caspar Check your logs, also read ^ ^ ^
 
10:03 AM
@Caspar the reason for internal server errors is usually given in the logs
 
And then there's SELinux ontop of that. This is the story of how I became an alcoholic.
 
@JayIsTooCommon I get the following:
menu.html:29 GET XXX 500 (Internal Server Error)
(anonymous) @ menu.html:29
probably doesn't mean anything to you but
Like 29 is the XML send
Line*
 
@DaveRandom thankfully, I don't have to support that yet. that's not to say that it's parsing httpd confs isnt miserable enough already without it
 
Ahh. Is it syntax?
 
I've been trying to forget the misery for a while now. Sometimes I wake up from nightmares in the middle of the night :s
 
10:06 AM
I'm new to PHP so I'm not the best at spotting errors.
 
The doctor said he'd seen this before. From a MySpace guy that spent 5 years working on ColdFusion.
 
Oops
Was just syntax
:p
 
Anonymous
@Caspar again, read about injection
 
@JoeWatkins like what?
 
@NikiC that turd yasuo posted
 
10:12 AM
Yeah. I learnt the hard way. Created my first website that used a SQL database, gave the URL to a few thousand people and woke up the next morning with all of the databases deleted.
 
2 hours ago, by PeeHaa
ugh can I vote against https://wiki.php.net/rfc/improve_hash_hkdf_parameter yet?
 
Anonymous
@Caspar and yet you're still using this code chat.stackoverflow.com/transcript/message/35631293#35631293 ?
 
@JoeWatkins oh
string hash_hkdf(string $algo, string $ikm, string $salt , string $info [, int $length = 0 [, bool $raw_output = FALSE]])
 
I was just playing around with a little something. I knew how to do it the unsecured way, but Ill probably convert it all to PDO later.
 
10:13 AM
yay, let's make everything required apart from $length, which is actually the one parameter you need in 99.9% of the cases
 
Anonymous
Do RFCs themselves require approving before they go to vote?
 
The vote is the approval.
Why would you need approval to get approval? Seems redundant, no?
 
well there's supposed to be some consensus that something is a good idea before it gets to RFC
 
If it's really that bad of an idea I'd think the person purposing the RFC would learn that in the discussion phase and take it upon themselves to withdraw it or not put it to a vote.
 
the vote decides if it will be merged, but you're supposed to listen to feedback all the way through, and if everyone is saying that something is a bad idea, imo it's very bad form to push ahead with an rfc anyway ...
 
10:16 AM
But I guess that's more of a decorum issue.
 
Anonymous
@Sherif No, not really - I think it's common for a draft of something to require an initial approval before going out to vote. Like an initial shit filter.
 
@JayIsTooCommon It's called an RFC. The point is to collect feedback first, before you bother purposing an implementation.
 
> Email internals@lists.php.net to measure reaction to your intended proposal. State who would implement the feature, or whether the proposal is only a “concept”. Proceed with an RFC if feedback is not negative or if a detailed RFC will clarify the proposal. Mail list subscription is at php.net/mailing-lists.php. (Reminder: always "bottom post" your replies. Never “top post”.)
 
Whether or not you're actually taking any of that feedback into account is another issue.
 
"proceed if feedback is not negative, or if a detailed RFC will clarify the proposal" ...
rfc/howto ^
you're not supposed to start by writing an RFC, you're supposed to react to feedback you get before the RFC
 
Anonymous
10:20 AM
@Sherif Yes, i'm aware it's an RFC... i was merely wondering if there was an initial "This is a valid RFC" phase.
 
@JayIsTooCommon My take on that is: if you're really that unsure you should probably have a discussion about it first.
It's not like the mailing list hasn't seen some pretty horrible RFCs in the past. But then again, PHP has seen a lot of new developers come on board recently.
 
@Sherif I used to maintain ~20, that was more than enough. Now my life is full of nginx and it is a happy place.
 
I honestly stopped paying attention to the mailing list a couple of years ago. Way too much noise, not nearly enough signal anymore.
@DaveRandom Yea, now I just drink single malt scotch so... we're on the same footing it seems.
:)
 
Apache: Feeding your drink problems since 1995
 
I didn't start using httpd quite that early.
Also, didn't have to deal with insane edge cases up until a few years ago, either.
But yea... pretty much
 
10:25 AM
I was 10/11 in 1995
I still maintain that MySQL is more displeasurable to administer than Apache, anyway
administer, use, spell, say, think about, everything really
 
heh
My Seek Well.
 
Hey guys. So, I have php which outputs a whole heap of objects
Like:
Object
FRI1
:
Object
FRI2
:
Object
MON1
:
Object
stuff like that
I access the PHP with
var xhttp = new XMLHttpRequest();
			xhttp.onreadystatechange = function() {
			    if (this.readyState == 4 && this.status == 200) {

			  	show = JSON.parse(this.responseText);
			  	console.log(show);

			    }
			};

			string = "GetTable.php?username="+username;

			xhttp.open("GET", string, true);
			xhttp.send();
Right now it logs the entire response text to the console
How would I only show the contents of an object?
 
Today feels like it is going to be full of code review pedantry already :/
 
why is wiki.php.net/rfc/typed-properties declined in: wiki.php.net/rfc even though the voting was successful?
 
morning champs!
 
10:37 AM
nevermind, I found the closed pull request
 
@MarcelBurkhard It wasn't. Language changes require 2/3rd majority.
 
34/57 < 2/3
 
oh ok, thanks
 
@Caspar it hurts my eyes to see you are still using xhttp ajax calls
 
marginal defeat, but some of the issues that caused opposition are being addressed I believe
So we can hopefully float it again soon
 
10:39 AM
@Naruto What should he do?
fetch?
 
server push, nods
 
@PeeHaa jquery ajax calls?
 
you are a bad person
 
Hah, I got asked to use jQuery today. I said no.
 
No, means no!
 
10:41 AM
you also got your c4 ^^
 
Programmers have rights too!
 
c4... what have you heard? -_-
 
we should start a union
 
@Leigh it was a joke..
 
10:43 AM
800 LOC PR not accepted because...
 
@leigh cool thx
sick of property docblocks :P
 
@NikiC :'(
 
@NikiC So weird that there are so many against it
 
@MarcelBurkhard yea, we have a guy here who still wants us to use docblocks on fully typed function signatures... because it helps him identify where one method ends and another one begins... like really? is that the only excuse to keep them?
 
10:45 AM
@Leigh You do have internal code recommendations right?
 
@Trucy Somewhere, but I've never read them.
And I've been here for 6 months now :P
 
:D
 
You should infer the recommendations just by looking already existing code methinks
 
Whats wrong with xhttp ajax calls?
 
10:50 AM
If you vote on PHP RFCs: Help us remove nasty left over crust from failed PHP 6: https://wiki.php.net/rfc/binary_string_deprecation #php #rfc
@MarcelBurkhard peepz are working on a better implementation
 
pastebin.com/bbDVRcMV <=== because, magic?
 
Anonymous
@JoeWatkins stop slacking @bwoebi
 
@MikeM. Because it treats it like a string. "curl_error" casts to 0.
 
Nah that's not the magic part
check the result Message
Something !== Comething...
 
There's nothing magical about what you showed me.
I'm explaining to you why it does what it does.
> Characters within strings may be accessed and modified by specifying the zero-based offset of the desired character after the string using square array brackets, as in $str[42]. Think of a string as an array of characters for this purpose.
So $_data['result']['message']['curl_error'] results in $_data['result']['message'][0] which makes it assign curl_error($curl) to the first character in $_data['result']['message']
 
10:58 AM
got it -.-
 
That's well defined behavior, not magic.
 
nvm
monday mornings...
 
It is Monday.
 
@Trucy The same guy asked me to create an index on a primary key, so I take his comments with a pinch of salt anyway
 
He asked you to create an index on an index?
Damn.. This guy should be a dba for sure.
 
11:02 AM
@NikiC any idea why people are voting against it?
 
"because it doesn't do any harm"
 
@Sherif iirc mysql doesn't index primary key
 
"if we decide to have native unicode, it might come in handy"
 
@Trucy Your recollection is not so good.
@Trucy You should probably also be a dba.
 
.....but it's not available now....because it already has an implementation.....so it couldn't be used even if it was handy.
 
11:05 AM
@Sherif I'm only beginning to learn about non-basic database usage
 
if all strings are by default unicode, then the way it works now is still useful ...
 
I know that if someone says the opposite of what I say, they're probably right
 
but note that none of the problems we had implementing native unicode have actually gone away ... they matter less because we have more memory to waste and faster processors to waste it with, but it's not a good argument imo ... these are just things I've heard in it's defence ...
 
@Trucy I see. So you just say whatever and wait to see if anyone contradicts you as a litmus test for whether or not you guessed correctly?
 
@Sherif No, I say whatever I think is correct
 
11:09 AM
I say what ever I compile is correct
 
"if it compiles, submit it" — my school motto during projects
 
@Trucy Would a better approach not be "learn what is correct first" before you say anything?
Oh, you learn this in school. Well... I can't compete with that.
 
@Sherif you're right, that's why I plan to get a book about postgre one of these days
 
@DaveRandom Someone streamed porn and you got it all?
 
11:11 AM
@Sherif I was referring to @user3548161 :) I learned stuff at school, but I prefer real-life teaching
 
@Trucy You prefer teaching? Shouldn't you go learn something first, before you attempt teaching anyone anything?
 
@Sherif Maybe, I will never know since it was totally unresponsive and I had to do a hard reset \o/
 
Just a suggestion.
 
@Sherif do you really think that is what she meant ?
 
@JoeWatkins Not sure. It's ambiguous I suppose. Could be interpreted either way.
Anyway, it's all in jest.
 
11:13 AM
@Sherif I never told anything about me teaching to anyone?
 
but note how you decided to interpret it ...
 
Oh, I see :)
 
@DaveRandom without clicking, something ran out of disk space?
 
Sure, it's funnier that way.
 
@Danack The link is just a demonstration of the fact that I manage to do this on a weekly basis
 
11:14 AM
@Trucy Don't take me too seriously at this hour. I'm merely amusing myself at your expense.
 
@Sherif noted, no hard feelings :)
 
Anonymous
in other words @Trucy, @Sherif is an ass, just hit that ignore button ;)
 
I compiled , I submitted , It worked better than everyone elses , I got a negative 1 ... class room teaching expects you to follow and do as you are told
 
btw @Trucy I've not merged that Jeeves PR yet because of all the work I'm currently doing on creating our own lxr (with blackjack, and hookers) and I'm not certain whether or not it will apply. I'll do my best to incorporate it though.
 
lxr
 
11:17 AM
You can have hookers in lxr?
 
L X R
 
This is news to me.
 
Doing it right now instead of the extremely dull real work I'm supposed to be doing
 
@DaveRandom don't! I did it blindly, and we later found the source of the extra hyphen: it was because the master version weren't affected to a branch (at least I understood it like this)
 
(with non crappy fqn)
@DaveRandom I'll allow this, 'tis monday
 
What would be the best exception to throw for an undefined index on an array?
 
YourCodeIsBadAndYouShouldFeelBadException
 
easy UndefinedIndexOnAnArrayExceptionErrorException
 
@DaveRandom lol
 
Anonymous
@Chris xy :)
 
@DaveRandom there, closed the PR.
 
Although probably make your own
 
I'm guessing OutOfRangeException?
@DaveRandom ah cool, ty
 
@DaveRandom with ...
 
That purports that PHP arrays are actual vectors in memory instead of hashmaps.
Blasphemy!
 
11:21 AM
@JoeWatkins Bridge and Butlers
These will be high class exceptions
 
Anonymous
:P
 
@DaveRandom you have been using your butlers wrong ...
 
No, you have been using your butlers wrong
 
lol
 
if you are using spl exceptions you are probably most likely doing it wrong
 
11:24 AM
That's the only way to do it.
 
FACT: code is read more often by a machine that by a human
Optimise for machine! Computers first!
 
Code is intended for human consumption. If we were to optimize for the machine we'd all still be writing in x86 binary.
 
Anonymous
@Trucy yep, we should just use binary. Give them a break.
 
I am trying to send email with "Spanish" language characters and with file attachment - using this example stackoverflow.com/a/12313090/430112
 
@JayIsTooCommon we should just manually execute each instruction and update our state machines
 
11:26 AM
When I use English text it's sending, but when I use spanish it's not sending
What might be the problem, I even tried utf-8
Content-Type: text/html; charset=UTF-8
but not sending that spanish content in mail
 
Anonymous
apart from the colour and design, the new nav bar is nice.
 
replace to $mail->CharSet = 'UTF-8';
instead of $mail -> charSet = "UTF-8";
you could go crazy and just do this $mail->FromName = utf8_decode($_POST['name']);
 
@user3548161: I am not using phpmailer or anything
I use this example
104
A: Send attachments with PHP Mail()?

Pragnesh ChauhanYou can try using the following code: $file = $path . "/" . $filename; $filename = 'myfile'; $mailto = 'mail@mail.com'; $subject = 'Subject'; $message = 'My message'; $content = file_get_contents($file); $content = chunk_split(base64_encode($content)); // a r...

 
oh i see
 
@Trucy All types of keys are indexed :) - Typically primary keys also have a unique constraint, and foreign keys need to be made on indexes.
 
11:42 AM
Hi ALL,

I have made regular expression and test here, its working fine here - https://regex101.com/r/TPdoOM/1

But when, I use with preg_replace(): its give the warring
Error: Unknown modifier 'c' in /
 
Anonymous
@shubhamjain paste your code
 
Does anyone know the status of PSR 14 Event Manager? It hasn't been updated on Github since May.
 
Anonymous
you probably need to use delimiters
 
Wes
\o hodor
 
Anonymous
hoi weswallington
 
11:47 AM
@user3548161: I am using Content-Transfer-Encoding: 8bit, is that correct?
 
Wes
hoi ojaysimpson
 
@JayIsTooCommon

here is code
<?php
echo preg_replace('/192.168.1.101\\\/clientprojects/', 'cits.in:8080', 'http:\/\/192.168.1.101\/clientprojects\/employmentexpert');
?>

I want o/p - 'http:\/\/cits.in:8080\/employmentexpert
 
Wes
@JayIsTooCommon the walking dead tonight. do you watch it?
 
@Gowri yeah looks correct .
why not use patched version of PHP mailer save you the trouble ..
 
Anonymous
@Wes new? Oo I didn't know this. I do but last season pissed me off a bit
 
Wes
11:53 AM
last season or this season?
 
Anonymous
sorry, this season. First half pissed me off
 
Wes
it wasn't great, they killed my fav :(
any particular reason new (arbitrary expression returning string)() doesn't work?
 
Jay are you doing PHPUK?
 
Anonymous
@Leigh nah, too steep :(
 
fair enough
 
Anonymous
12:06 PM
what day are you doing again?
 
@Wes Doesn't class lookup happen in compile time?
 
Anonymous
and how the f with that spelling..
 
Unless you use reflection
 
Wes
@MadaraUchiha no
 
Thurs, Friday's talks did not look inspiring
Also, free bar
 
Anonymous
12:07 PM
:P
 
I'll have some work chum(p)s with me, so wont be too lonely without you
 
the correct spelling of friday is beer
 
Anonymous
@Leigh they won't be near as good as company as I'd be.
 
!!reminders
 
2 messages moved to Trash
 
12:14 PM
Thought it would remove the initial command as well
 
It's only for the builtins for now
But @JayIsTooCommon may as well fix dem all
 
I see. Alsoo @PeeHaa did you pull the latest yet?
 
Nope don't think so
 
Anonymous
@PeeHaa it'll take years, also gonna let it sizzle for a bit - Christoph has refactored most of my poop and don't want to change everything until I know we're sticking with that VO
 
That ^^ is in
 
12:21 PM
3 messages moved to Trash
 
Anonymous
Just to prove it works before the pull :D
 
:P
 
TEST JEEVES
 
Anonymous
What are tests?
 
What DaveRandom does
 
12:22 PM
@JayIsTooCommon It's those things you never write.
Also morning
 
Anonymous
oh them things
 
Anonymous
hoi madarmochomoe
 
o/
 
hOi Jay wa amarini mo ippan-tekidesu
 
12:24 PM
:D
 
I have a TypeScript presentation I really should be working on but am too lazy. So here I am!
 
On that note: Reveal.js is pretty awesome.
 
working the last 12 months with typescript has been okay awesome... all things considered
 
jeeves is cool, but every time I look at a file, I'm disappoint ...
 
12:26 PM
@RonniSkansing I know! It's gotten soooo much better
It's like, everything JS is missing
 
Yes just lots of nice features and awesome IDE support
 
Anonymous
@JoeWatkins i'm gonna give it a go at some point, last time I looked I couldn't get my head around shit
 
I looked at it back when it was 1.4, and it sucked a lot
 
But since 1.8 it became pretty amazing, now at 2.1.6
 
12:28 PM
uh I need to update then
trying out Dart again these days
(the typescripting is work related)
 
@JayIsTooCommon eventually I'll have to do it myself ... so we don't look like chumps ...
 
Yay to that in advance
 
Anonymous
@JoeWatkins we could do it as a couple...
 
Anonymous
@Ekin I hope you're still yaying..
 
@JayIsTooCommon I don't really do teamwork ...
 
12:31 PM
@JayIsTooCommon You two would make a lovely couple
 
:D
 
Jay ❤️ Joe
 
... I suspect his wife might object
mornings
 
Anonymous
@JoeWatkins fine. Delete my number.
 
Code Coverage Report:
  2017-02-13 12:39:58

 Summary:
  Classes: 36.00% (45/125)
  Methods:  9.77% (42/430)
  Lines:    2.63% (99/3758)
/me cries
 
12:41 PM
user image
4
I will just leave it here
 
lol...
 
@JoeWatkins why?
 
@Gordon Is that Ivanka's design?
Did Nordstrom take that one out of commision?
Also it needs a 12 foot long tie.
 
@Leigh TIL :)
 
12:55 PM
@bwoebi some of it is stupid, and as near as makes no difference none of it is tested
 
does anyone has an idea why this code throws an exception every time? gist.github.com/MagicTrucy/af48aab881cfa00e35a214c364f2d0a7
Without it, it works fine
 

« first day (2312 days earlier)      last day (2633 days later) »