« first day (877 days earlier)      last day (4288 days later) » 

00:03
I´m going to take a shower and shave. I have to act decent again tomorrow :(
Laters all
Shaving is for wussies.
4
I know I know :(
:-P
later
00:05
later
@PeeHaa your poor beard :(
@DaveRandom the issue is that it is in Doctrine library
later
@DaveRandom therefore I can't just go and change it there.
Excuses.
00:10
@Eugene So you'll need to pass a single dimensional array then, but I have to be honest I don't really know doctrine very well, although I know there are some around here who do, including at least one regular contributor to the project
Ou. Okey. I'm using oldy
1.2.4
Not second
so... why are globals EVIL ?
The reason, why I'm mentioning it, is that earlier, before I restarted my project and took newer revision of 1.2.4 everything worked and now it doesn't. Will try to figure out why and how.
:))) globals
user895378
@Lusitanian That's just awful
00:18
@rdlowrey It makes puppies cry.
meep meep
@Lusitanian I'm really tempted to pin it so everyone can enjoy it tomorrow morning
@DaveRandom :)
any reason using json_decode($data, true) wouldn't work on this: pastebin.com/MuANBxV6
do i need to replace any characters? O.o
@KevinMurphy yes. it's not json.
@KevinMurphy use unserialize instead
00:22
lol
That is really not JSON, pretty immediately recognisably so
indeed
well... herp derp on me.
... forget this happened? :D
you still have time to delete your messages! :)
maybe someone who reads the transcript can have a laugh :D
00:25
although i swear i used unserialize() first and nothing returned. stupid me. enjoy :D
@KevinMurphy Is it a session file? They use a slightly odd form of serialize() IIRC, there's something about them that's not quite the same, they may not unserialize properly
Why is that? or did I just make that up?
user895378
@DaveRandom Any input on how many seconds after sending a close frame a websocket server should wait to receive the corresponding close frame from a client before forcibly closing the connection?
user895378
Because you don't want to wait indefinitely for a garbage client implementation that doesn't return a close frame in response.
@rdlowrey are you looking for a sensible default here?
user895378
@Lusitanian Yes, that's what I'm looking for.
00:28
as it seems that that value should be exposed as a config param
user895378
Yes. Exactly. I was thinking five seconds as a default. It doesn't really cost anything to wait longer. The important thing is just to have a limit in case you're dealing with a non-conforming client on the other end.
@rdlowrey I've been just throwing the connection out as soon as I send a close frame, to me it's game over and I don't care what the other end thinks about it, but realistically if you haven't got one after a couple of seconds you're not going to get one probably
user895378
Dirty RFC violator. I'm calling the IETF police.
5
I mean at the end of the day your ws clients are almost always going to be JS, and the async nature of JS means that it's going to be handled pretty much immediately.
@rdlowrey They'll never take me alive!
Actually I don't think that's a violation, there's nothing in the spec that says you have to process anything after you've sent a close
user895378
00:33
I don't think you're right about that. Let me double-check, though.
You can legitimately have a TCP packet with PSH/FIN set as well
So I don't see why the client should care about it
user895378
I'm pretty sure you're supposed to wait for the client close frame. The server is supposed to hold the socket's TIME_WAIT state.
user895378
If you close immediately before the client responds then the client will be stuck with the TIME_WAIT, no?
user895378
Wait, those don't apply :)
user895378
> Once an endpoint has both sent and received a Close control frame, that endpoint SHOULD Close the WebSocket Connection as defined in Section 7.1.1.
user895378
00:37
There we go.
The close frame to me is completely pointless. It's the end of the connection. It is demised. It is no more. It is an ex-connection.
Just close the TCP socket and be done with it
@DaveRandom like an ex-girlfriend
just close the relationship and be done with it ;)
Although I know that's not what the RFC says
user895378
00:39
It caused me greate heartache, but I've implemented it fully at this point, so oh well.
you dirty rfc followers....
@Lusitanian Meh, nowt wrong with a bit of break-up sex :-P
@DaveRandom strongly debatable
@rdlowrey Back to the original question then, I would go for 3 seconds.
user895378
Sold. 3 seconds it shall be.
Oh yeh, it should be approved random number
so 4
:)
i was hoping you'd do that
user895378
Along the same lines, I'm currently sending a ping heartbeat each time the connection idles for 60 seconds without activity. The interval is configurable (0 seconds disables the auto-hearbeat). Is 60 a sensible value there or would you guys say something different?
Can't find it, you do the honours
00:41
my xkcd fu is just not good enough
would anyone like to help me with a small project in exchange for some $$ hehe :D
user895378
Only bad things happen when you offer $$$ to strangers on the internet.
i mean PHP channel is just full of lovely people
@rdlowrey What you are talking about there is badly-configured uber-NAT traversal (university networks often fall into this category), and tbh, depressingly, 10s is more realistic :-(
=]
lol @Lusitanian
00:45
Ahh so that's when @Lusitanian's brain was
user895378
@DaveRandom Well, it would also trigger if you were operating say, a chat room, and no one joined the room or posted a message for X seconds, so it's not necessarily NAT traversal only.
user895378
So you're sure sending a few bytes over the wire every 10 seconds is ideal in that scenario?
@rdlowrey Yes it is. Because if there were no NAT the connection would just live forever as long as both endpoints stay up
The only reason you ever to heartbeats is to keep the route open through intermediate devices
well i guess that offer was declined :D talk to y'all lataaaaa
user895378
@DaveRandom I see. I'm pretty inexperienced in that area, so I'll take your word for it :)
00:48
@rdlowrey It's far from ideal, but you just kinda have to live with it. But it is only a few bytes, in fact it's only 2 TCP payload bytes + header in either direction
Right I'm softcore and I'm hitting teh hayz
nighty night @all
user895378
@DaveRandom Later dude.
@DaveRandom s0f+¢0r3
01:05
grr.
SRP is a painz
...wat
this API i was using for a game has you use a cookie when making a request but it used to be super simple to get a cookie
now they use SRP to grab a cookie and it confuses the poop out of me
poop is allowed, correct? :D
yup
user895378
"SRP" as in Single Responsibility Principle? Or some random other thing with which I have no familiarity?
Secure Remote Password protocol
user895378
01:15
Oh ... sounds dumb.
basically, to obtain a cookie, you make 3 requests with a bunch of hashes
i'm so confuzzled
нооооооооооооооооо
i mean:
nooooooooooooooooo
here's someone's java script that contains a getCookie() function but i'm lawst. raysforge.net/repos/HonReplayTextExtractor/src/net/raysforge/…
if i could just convert it to PHP and have it work, that's the goal but I don't know where to start hehe
life's so difficult
01:20
@KevinMurphy that's java, not javascript
i know i said java script not javascript :D
one doesn't write scripts in java, i'm confused
i'm sorry
java file
boom
my bad.
01:21
lolz
thinking about it i see i was wrongz
FORGIVE ME
@Lusitanian looking at that file, does it seem like SRPAuth.java is required?
might as well ask xD
02:22
The last message was posted 1 hour ago.
@0ɟɟouoɟıɹʇuınbɐɥs is that automated? O_o
@Ocramius no.
Once I made something similar automated, but people didn't like it.
also: why am I working already at this hour? =_=
67.184.73.17/Website
02:24
eager to start the week
67.184.73.19/Website
@MoussaHarajli Use the sandbox to test things

Sandbox

Where you can play with regular chat features (except flagging...
02:58
anyone here ever work in Xcode?
I am trying to write an app in Perl, wondering if anyone every tried it...
@0ɟɟouoɟıɹʇuınbɐɥs you there?
@DemCodeLines yeah?
03:14
@0ɟɟouoɟıɹʇuınbɐɥs what did you write ?
@kaᵠ A script that automatically posts messages like "1 hour later..." when the last message was posted 1 hour ago.
Dec 29 '12 at 6:07, by Shaquin Trifonoff
1 hour later…
wow, that's long ago
03:35
@0ɟɟouoɟıɹʇuınbɐɥs change it to much much later
i liked it
kill all automated garbage! :)
@Jack but you're automated...
03:59
@MirwaisMaarij The site is up
04:56
hi guys,

i m getting an error on my site

http://technew.in

this is my query

SELECT tag, COUNT(tag) AS total FROM my_tags GROUP BY tag ORDER BY RAND() LIMIT 20

i m getting this error only sometimes.

mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource

why this happening only sometimes ???
anyone here willing to be a CTO?
for a startup....
05:19
@DinoBabu show some code
05:38
Hi buddies ...
any one provide answer for this...
0
Q: How to create categories and sub-categories in left side in opencart?

display NONEI am beginner in open-cart.I currently working in web2print extension in open-cart.I need to create categories and sub categories in left side.I already display categories menu in left side via admin panel,but i need to create display categories and sub-categories in left side bar with similar m...

i am struggling for two days...
06:06
@Dino Babu is this error comes where tags are not avaliable?
jay
jay
06:45
Hello good morning to all of u
can any one solve my problem
?
@DinoBabu
07:20
good morning
Morning Everyone
Gd Afternoon
@DinoBabu you need to check if the resource u are getting isnt a boolean
I guess most of the time, u get this kinda error when u don't check if variable has some value in it.
@DinoBabu a missing error check. it's a common mistake. It only happens sometimes because the query only sometimes does not return a resource.
@hakre can u tell me who can close a question, if i check any question and thats worthless, how can i put effort to close it
4431
A: RegEx match open tags except XHTML self-contained tags

bobinceYou can't parse [X]HTML with regex. Because HTML can't be parsed by regex. Regex is not a tool that can be used to correctly parse HTML. As I have answered in HTML-and-regex questions here so many times before, the use of regex will not allow you to consume HTML. Regular expressions are a tool th...

^someone flagged it as not an answer LOL
> not an answer – Dec 11 '11 at 19:54 × 2. deemed invalid by 3 users
@ScoRpion... stackoverflow.com/privileges/close-questions - you either can vote (if you have the 3000 reputation) or you can flag a question if you don't have enough reputation (or both in grave situations)
PLB
PLB
@Alexander Probably, because some people argue that regex might be used for parsing [x]html. Anyway, as far as I know flags should not be used to indicate inaccuracies.
@PLB, true. But that answer is there for historical reasons.
@Alexander probably me
@Gordon how can't you remember something like that?
@Alexander i acknolewdge the humor in the answer but it has done more harm than good. people get slapped down with that answer. it gets linked frequently under parse html with regex questions and the only thing people take away from it is that "you cannot parse html with regex because html is not regular" and that's not true
@Gordon what's not true? "html is not regular" or that that's the only thing the take from that answer?
@Alexander see the comments to stackoverflow.com/questions/4245008/…
@Alexander until that exchange I used to link the rant under each and every question. never again after that exchange. in fact, whenever I saw someone do it then, I shared tchrist's pain. that's also why I deliberately included a regex section in stackoverflow.com/questions/3577641/…
08:26
@Gordon granted. Now, why was this never raised as a concern is MSO will remain unanswered?
/me gtg
PLB
PLB
@Gordon I agree with tchrist's comments but in most cases patterns used by developers (at least in questions on SO) to parse html is buggy (i.e. will fail if html is malformed). So this answer (even it's not accurate enough) encourages people to use DOM parser so their code is less buggy.
@PLB i doubt it. the suggestion to use a dom parser comes only in the end, after the fancy letters. it gets lost.
PLB
PLB
08:43
@Gordon I agree. That answer needs to be edited (it's community wiki, is not it?).
@PLB locked by Marc Gravell♦ Mar 13 '12 at 20:04
you cant touch it
Hey guys. Any thoughts on saving options automatically via AJAX in the style Google+ does it? We are having a discussion about that and I could use more opinions. We have a huge interface that allows to insert/edit translations of text labels. Right now the interface saves the content of one of the inputs via AJAX when the users stops typing for at least one second. Some of my colleagues argue that it should be a conscious action evoked by the user rather than doing it automatically.
I, however, dislike the idea of having a button after every one of the input fields (there can be hundreds) and require the user to click those after every edit to one of the text fields...
PLB
PLB
@Gordon I know that I can't touch it and even if I could, I would not do it because I don't have much experience. But there are folks here who can add invaluable information to that answer.
@PLB i think the consensus is that it should be left untouched because for its historical value. its one of the most famous answers on so. its kinda like a meme of its own
969
A: RegEx match open tags except XHTML self-contained tags

Kaitlin Duck SherwoodWhile it is true that asking regexes to parse arbitrary HTML is like asking Paris Hilton to write an operating system, it's sometimes appropriate to parse a limited, known set of HTML. If you have a small set of HTML pages that you want to scrape data from and then stuff into a database, regex...

Actually, this is also not an answer.
More like an elaborate comment.
08:47
@TillHelgeHelwig iirc there are studies suggesting that the instasaving is fine as long as their is a visual cue that it got saved
Well...there is a AJAX loading spinner and an image (either showing success or failure) and if one of the saving processes failed to execute, a save button is shown at the end of the way too large form. Seems user-friendly enough to me, but I guess the major concern is the lack of versioning.
If the user gets interrupted while typing, an unfinished label would be saved.
Maybe autosaving is only reasonable if you have several options available, but not for text input?
@TillHelgeHelwig im no uxpert. maybe you will find what you are looking for in ux.stackexchange.com/search?q=autosave
@TillHelgeHelwig i dont understand the argument about versioning. webforms dont have versioning. that something you'd implement at the db level
@TillHelgeHelwig if you are concerned about the save button, maybe try the suggestion in ux.stackexchange.com/a/2757. put a dummy savebutton that simply says: it was saved when clicked
hi guys....
please check my question here
http://stackoverflow.com/questions/15330384/users-cant-access-our-web-content-before-they-are-logged-in
@Gordon The autosaving idea only came up because the form can become very large. The user can restrict the number of input fields by providing search criteria, but for a new language about 1500 labels would be shown. And while in normal circumstances I would provide some kind of workflow that will include pagination and going though the pages one by one...in this case it would be overkill, because the application should be extremely light-weight. That's why we implemented autosaving.
Preventing data-loss is the main issue here, but seems to me that autosaving can open up a new flavor of data-loss.
I guess I will hook the AJAX push to a button that is only shown if an input field has been modified.
yaaaaaawwwrning
09:00
@Gordon Thanks for the links and ideas. I'll throw that into the mix nonetheless.
Mornings
@TillHelgeHelwig how about a temporary version
@TillHelgeHelwig you could also provide a checkbox [ x ] autosave form values which is checked by default and when you untick it the save button will appear
@Gordon :-X I don't like that idea for anything ever. That's one step away from progress bars that go to 100% in 1 second before sitting their for 5 minutes doing f*ck knows what
@andho Too much complexity.
09:03
@Gordon That's much better
@newbie $login=mssql_query("SELECT * FROM tblMstUser
                    WHERE LoginID='$_POST[username]'
                    AND PasswordPHP='$_POST[sandi]'");
pick your admin user and login with the following password please ' or 1=1
also, you seem to save passwords in plaintext in your database. it is better to save hashed passwords
also, you do`style="height:190px;width:115px;float:left;"` inline styles are bad practise. consider moving them to a dedicated stylesheet
and <br>&nbsp;</br> is invalid. br is an empty element
@Ocramius This is a ridiculously vague question I know but it sparked my interest a bit last night and I don't know Doctrine at all so I figured you'd be the best person to ask: Someone was in here last night complaining of a warning being emitted from Doctrine code (internally) because of an array to string conversion, basically because a multi-dim array was being passed through array_diff() - is that just them doing it wrong or is it a known issue with Doctrine? (seems kinda basic)
@DaveRandom usually because they don't validate their schema
@DaveRandom doctrine does not validate stuff at runtime, since loading metadata is a heavy process that causes stat calls
09:19
I have a problem with handling modal windows using twitter bootstrap
5
Q: Bootstrap modal appearing under background

natlinesI have used the code for my modal straight from the Bootstrap example, and have included only the bootstrap.js (and not bootstrap-modal.js). However, my modal is appearing underneath the grey fade and is non editable. Any ideas why this is?

Any help here will be highly appriciated!
@indago this is the PHP chat room. you might have better chances getting an answer in one of the js/css based chats
@Ocramius makes sense. I will point the guy at those two messages if he shows up again. I really should learn how to use it myself as well
1 message moved to bin
@DaveRandom you can ask me anytime. I wrote an (ugly) presentation about it at marco-pivetta.com/doctrine2-orm-tutorial
@Ocramius Thanks, I'll check it out
09:24
monirng
@indago By "positioned the default way" I presume he means they have position: static;
@Jimbo yo
1
A: Stripslashes produces Internal Server Error?

Your Common SenseInternal Server Error 500 when translated from Webserver language, means Developer! No need for guesswork! Look into error_log for the actual error.

Somehow his quality of answers has gone down since the ban.
I just have to bring this out for your enjoyment by the way:
10 hours ago, by Lusitanian
> Our stack is a combination of all that’s bright and shiny right now; we use MongoDB and Redis for storage, Scala and Akka to create a highly concurrent service tier exposing our engine to client applications via JSON, and Rails, iOS, Android and Windows Phone to take that data and produce amazing, native experiences for both web and mobile devices.
Or maybe I just wasn't around long ago to know his previous quality of answers ;-)
@Jack I know. Also he never responds to comments either, he's gone completely non-confrontational. Hopefully it's just temporary until he feels he's slipped back under the radar
09:28
@Jack well, why do you think he got banned in the first place
@Gordon I guess that's a fair point :)
ttyl
@Jack i mean, his answers used to be correct mostly, but in a completely non-constructive and offensive manner
@Gordon He got banned for being abrasive, I didn't like the way he went about it but his answer quality (informationally) was usually quite good and complete, even if he did act like tereško in a bad mood all the time.
09:31
@DaveRandom maybe the colonel is @tereško :D
I have wondered about that, there is precious little information about that guy that can be derived from teh internetz, I have looked, he doesn't seem to have a presence as that "character" really anywhere else
Maybe it's Jon Skeet letting out his repressed anger from being incessantly helpful all the time
2
That would be quite understandable heh
@DaveRandom lovely thought
@gordon...ya i will change the password method. but in this problem i just can't make user session.
@newbie yes, I know. but you got bigger problems to fix than that as long as your code is that wide open to sql injection and you store pws in plain text
09:36
@Jack btw if your interested we've just set up an "alpha" release channel for the plugin, auto-built off the alpha branch, so you can get instant access to new features as soon as whoever wrote them feels they are stable enough to run (it's likely to be generally a bit unstable though)
@DaveRandom almost correct. the levenshtein distance is just one 1
@DaveRandom With "the plugin" you mean cv-pls? :)
Hmm, pieterhordijk == peehaa? :)
09:43
@Ocramius yuml.me class diagrams cant do static though. I asked the guy to implement it via twitter but he never responded. i am thinking of rebuilding the whole thing with php
Morning
monring @deadlock
Hi @Jimbo
I am having serious issues with my time management skills
@Ocramius Slide 13, title says "Person", class name says "Comment", is that a mistake? I presume these are slides that support a presentation you've done, have you got a vid of it?
@Gordon interesting. For me that was the same as not achieving anything
Since the answer is still there. It was merely overlooked
As for me, I have different reasons to recommend a parser. A newbie is a newbie and they don't understand the extend of a half-assed regular expression can end up in
I have seen such regular expression for HTML answers with no disclosure about it
09:58
Those are the best expressions.
@Alexander lack of explanation is a common problem with all regex answers
I always use expressions in /x mode with comments in the expression in my regex-based answers, but then you have to explain what /x mode does which makes the whole thing even more daunting to newbies :-(
I'm still impressed by the comments in the MSO thread
Not in a good manner though
@DaveRandom Yeah, /x is great for that :)
Turns out that it's also good for preventing unwanted breaking comments when you ... ahem ... parse html
@Jack Heretic!
burn the witch, burn the witch, burn the witch
:-P
Anonymous
10:12
2 gold badges === respect
@DaveRandom hi
@DaveRandom But but, it wasn't me
:)
@DaveRandom are you able to spot this Doctrine user, about whom you where talking yesterday?
102
A: How do you validate a URL with a regular expression in Python?

noskloHere's the complete regexp to parse a URL. (?:http://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\. )*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+) ){3}))(?::(?:\d+))?)(?:/(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F \d]{2}))|[;:@&=])*)(?:/(?:(?:(?:[a-z...

OMG!
59 mins ago, by Ocramius
@DaveRandom usually because they don't validate their schema
59 mins ago, by Ocramius
@DaveRandom doctrine does not validate stuff at runtime, since loading metadata is a heavy process that causes stat calls
10:18
@DaveRandom okay.
Morning yall
@PeeHaa hi
@Jack That's actually a really interesting problem, and not really a "parsing html with regex" issue. The fact that that's what the OP was doing kind of isn't relevant to that specific problem/solution
(+1)
@Gordon yeah, that yuml thing is still very useful though :)
@PeeHaa monrings
10:20
@DaveRandom It actually took me a while to realize what the problem was lol
@Eugene ./vendor/bin/doctrine orm:validate-schema - do it often
@Ocramius I'm using 1.2 doctrine by the way.
@Jack Yeh the question's not really that great, could do with an edit to make the problem clearer (possibly with an example), might do it in a bit when I have time
I might add that in my repertoire of quirky interview questions ;-) @DaveRandom
@Eugene well, you won't get any support for that
10:22
@Ocramius :(
It's dead :\
@DaveRandom for 1.2... yeah, I'd expect notices. It's a big ball of mud :D
@Ocramius Oh I missed that element of it :S
@Ocramius I know, but the reason for my confusion is, that at some point it did work fine for me and I have no idea what changed due to what I get an error.
@Jack Yeh be careful though, it's slightly unfair, I actually had to get it in a syntax highlighter to verify that the problem was what I thought it was, comments with closing tags it aren't exactly something you regularly come across
@Eugene well, for sure doctrine 1.2 didn't change in the last 2 years :D
10:24
@Ocramius I have three tables in db one of them is linked to other two with FK. I've generated models. Wrote Doctrine_Query that uses innerJoin and this is where I got Notice with array_diff.
Actually I'm kinda surprised the parser does that with inline comments, I understand with extended comments but you'd have thought inline comments would just tell the parser to ignore the rest of the line. I guess it's a templating engine feature but you could just force people to use extended comments for that, it would make it a lot more intuitive IMO
@Eugene probably the thing that changed is your error reporting settings then ;-)
Hmm. Let me see.
i asked if is it possible to access php service from asp? — user1688401 6 mins ago
@DaveRandom O_o you are correct sir.
10:29
@Eugene I mean the really important point is that its not going to work like you would probably want it to. All the 2nd level arrays will be converted to the string "Array" and they will all compare as equal, regardless of their inner structure. So you need to flatten the array somehow or patch the Doctrine code in order to resolve it
@DaveRandom I think last one will be quite difficult
@Eugene So the error has always been there. I guess the simplest solution, ugly as it is, would be to @ the line. Although you didn't get that advice from me. In fact I'm not even here. You. Saw. Nothing.
Suuuure :)
@DaveRandom
You really thought you could get away with that?
;)
@Ocramius would you say, that doctrine 2 is radically changed in version 2?
does it use active record as well?
10:36
@PeeHaa Meh, he's already using year old unmaintained library code, what harm can one little suppressed error do?
/gets eaten by velociraptor
@Eugene no. it's using data mappers
@DaveRandom Welcome to extremes ;) I'm thinking about moving to version 2, just don't all ups and downs yet.
the @crypticツ has been very silent over the weekend. likely out of wine.
10:39
She's probably having her annual sleep
3
@Gordon is there a way to generate models like it was available in 1.2? Doctrine_Core::generateModelsFromDb(...
@Eugene I don't know. But if it has, it doesn't make much sense to me. Because that would mean you have Entities corresponding directly to database structures. And the whole point of DataMappers is NOT to have that, but be able to develop db and object model independently.
@Eugene no active record - for the 2^25th time: marco-pivetta.com/doctrine2-orm-tutorial
This should be part of PHP, being a web framework and all:
$pageURL = 'http';
 if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
 $pageURL .= "://";
 if ($_SERVER["SERVER_PORT"] != "80") {
  $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
 } else {
  $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
 }
@andho there's enough http request classes doing that
10:53
and you dont need that anyway
Actually you do if you want to do header redirects and remain standards compliant
@andho Also don't add port 443 by magic please
@PeeHaa thanks
@andho However, use HTTP_HOST over SERVER_NAME, and don't trust either, both are XSS vulnerabilities, always htmlspecialchars() those URLs if you are going to output them into a web page. Also using HTTP_HOST removes the need for port detection.
10:55
@Ocramius hmmm, request classes should be first class citizens
@andho and that because?
SplHttpRequest
Oh, also you should !empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on", it's not always defined
@Ocramius because it's a ubiquitous functionality on the web. love the WSGI standard
@DaveRandom okay i'll just use a Http Request class ;)
10:57
@DaveRandom yes, you need it for redirects but you certainly dont need that to construct urls in pages becase there you can just use //example.com/img/asset.png
@$_SERVER["HTTPS"] == "on"
@webarto I've not seen $_SERVER["HTTPS"] around in here today, that ping probably won't work.
@Gordon that's a tight coupling to the domain. it's always a concern to get the base url for an app. most full stack frameworks provide it

« first day (877 days earlier)      last day (4288 days later) »