« first day (927 days earlier)      last day (4246 days later) » 

14:00
@Gordon do you find it less readable than php?
@dyelawn highly
@Leigh +1 sir; didn't know it could be broken that far.
@igorw: awesome logo
@Bracketworks Also, you shouldn't be able to use extract() to overwrite: lxr.php.net/xref/PHP_5_4/ext/standard/array.c#1394
@Leigh Worked though;
14:02
extract(['_SESSION' => array('ma session!')]); anybody?
@Bracketworks Must be failing at the EG(scope) stuff then
@ircmaxell indeed :) will have some stickers made
I'm runnin 5.4.8 too
So no wacky < 5.2 stuff.
@Gordon ok, agree to disagree there. so do you not use any framework--and its generated code--on anything where you have a choice?
@Bracketworks you were trying to do it from within a class right?
14:06
@Leigh Nope
@Bracketworks well duh then
lol, oh; I thought it would filter regardless of scope.
@dyelawn when I have a choice I avoid frameworks. I'd rather pull in components as I need them
extract protects $this inside the class
Oh, that's the call to EG, I get it.
14:08
yep, it checks the scope, if you're in the global scope it's happy to let you overwrite it
So that check isn't done for variable variable assignment
Hence the $o = 'this'; $$o = 42; working, regardless of context.
@Gordon amen!
@NickFury hello agent of SHIELD
morning!
14:31
ahoi
Ohmygod, please tell me nobody likes using if ( . . . ) : and endif; in views?
nobody likes it
same goes for <?php ?> on every line. still lots of people do it.
i'm avoiding IFs in the view as general rule
@Jimbo i do. I am with @tereško on avoiding ifs in templates but if it cannot be then I do like the syntax better because it doesnt leave me with a line like <?php } ?> which I find less readable than <?php endif ?>
@Jimbo I do as well. Much more reasonable than hanging { and <?php } ?> all over the place.
14:34
<?php if ( . . . ) { ?> <h4>HERRO</h4> <?php } ?>
Most IDEs can't resolve it - won't tell/highlight you where the opening is.
for if/endif
@tereško Not even with isset() ?
or for foreach/endforeach while/endwhile
yeah , the orphan <?php } ?> makes for bad debugging in templates
wat?
why is it bad for debuggin ?
14:37
Because it can have several meanings?
@Gordon Yeah I suppose. I'm just not keen on "endif" I think
I'm a bracket wh*re.
@Jimbo <h2><?php echo isset($title) ? $title : ''; ?></h2>
If you're using a real IDE, then you click the bracket and it highlights the if/foreach/whatöver
@tereško Ohh okay, ternary's it is then ;)
<h2><?php isset( $title ) AND print $title; ?></h2>
14:38
or that
Where was the daily @crypticツ of Monday?
Question: I'm slowly switching from WordPress > Symfony2. Now I'm a bit stuck with an exception: Got a services.yml file that keeps failing with an Exception telling that the class wasn't found, while I know that it's there.
@kaiser clear your cache
and make sure that the bundle is registered in your application kernel
/root/app/AppKernel.php
I looked into app/console container:debug and see all four services.
btw: related to this question
@dyelawn it is
posted on April 30, 2013 by Chris Shiflett

Dark patterns have been around for a couple of years, but it seems like the concept is gaining steam lately. It’s normal for design (and copy) to try to modify behavior, but with more and more frequency, I feel like apps are trying to trick me rather than encourage me. The example that prompted me to write about this was a trick question asked by Cobook, an app that was described by my friend

14:42
Problem is that it's failing when it's loading the services.yml from AppNamespace\Bundle\BundleName\Resources\config\services.yml. Config tree is defined inside DependencyInjection\Configuration.php and app/console config:dump-reference AppNamespaceBundleName shows the correct tree.
wut :P
-4
Q: java code doesn't work properly

user2175697i have html form .. there is so many inputs and i catching the value using jquery and send it to php page to process it ,, i think this calls ajax so there is my code and i don't know where is the issue function update_customer(){ var first_name= encodeURI(document.getElementByName('first_nam...

yet he tagged the question javascript?
var worktype1 = $("#worktype").is(':checked')?1:0;
like that one.
now they're "dark patterns"? O_o
Gawd! “The antisocial network: @path texts my entire phonebook at 6am” http://www.branded3.com/blogs/the-antisocial-network-path-texts-my-entire-phonebook-at-6am/
14:45
@Ocramius haha :P
@PeeHaa埽 The title is a statement I agree with, at least...
hehehehehe
Good day
@dyelawn forgot to answer that one: cache is cleared with app/console cache:clear --env=dev --no-debug. doesn't help :/
@Eugene Goodday mate!
14:53
Hello everyone!
hey
How is it going?
Guys, any quick suggestion on how to parse and replace following. i.e. I have route matching '/_ticket/show/xxx' and I need to check if any segment has one _ as first symbol, then this segment should be doubled. Like '/_ticket/show/xxx' => '/ticket/ticket/show/xxx'
@Eugene why?
@Gordon why what?
14:57
@Eugene why does it have to be doubled and why dont you know how to use strpos?
I thought pcre usage would be more welcomed in this case, no?
Since route is dynamic
@Eugene what lang?
@Gordon could work as an alarm in the morning... Suddenly, everybody is calling you at the phone :P
If the only thing you need to find out is whether there is some underscore somewhere there is no reason to not use strpos
@kaiser what do you mean?
14:59
sorry. coming from wp.se chat room and forgot that this is PHP only.
@Eugene preg_replace ~/_([a-z]+/)~ , /\1\1
@PeeHaa埽 I need to find where and replace with what comes after in this segment and of cource in case if there is only one underscore symbol in front, i.e. /__ticket/show/xxx shouldn't be parsed
@Eugene if you don't need to know where the _ is, then just replace
@Eugene what is the cause for routes like that? why do you have to have such ugly things?
15:09
@kaᵠ I only need to know, that there is one per segment of the route and that it is at first position of the segment
@Eugene then what i gave you will work
foreach ( explode( "/", $route ) as $part => $r )
{
    $uscore = strpos( $r, "_" );
    if ( ! $uscore OR 1 !== $uscore )
        continue;
    $found = $part;
}
the you'll surely know that you $found it :P
@Gordon route will be converted to 'module/controller/action' as you probably guest already. But one module can have different controllers. And in case if module equals controller name, then I don't want to use doubled like /ticket/ticket/show/xxx
@Gordon and sorry, must disagree. Don't see any ugliness in that.
@kaiser wp style :)
15:14
5 mins ago, by Eugene
@kaᵠ I only need to know, that there is one per segment of the route and that it is at first position of the segment
You just asked if there was one ;)
@kaiser I know. I said, that wp style
@kaiser better
foreach ( explode( '/', $route ) as $part => $r )
{
    $uscore = strpos( $r, "_" );
    if ( false === $uscore || 1 === $uscore )
    {
        continue;
    }

    $found = $part;
    break;
}
Ron
Ron
0
Q: Recursive File listing stops after 2 files

RonI have the following code to list all files (in the direct folder and sub folders). $imagesDir = '../Stock_Images'; $di = new RecursiveDirectoryIterator($imagesDir); foreach (new RecursiveIteratorIterator($di) as $filename => $file) { echo $file->getPathname() . '</br>'; } The problem is t...

@Eugene uh. the break;. forgot it.
@kaiser also 1 == ... not !=
ok. Guess we can end this with a joke gone wrong :P
15:18
eiw
@ircmaxell did you get the explorer package yet?
it will take time
@ircmaxell yep, was just asking since that robert scoble is basically spamming my feed day and night about it :P
Who's he?
Allergies are in full force here, agh
@Ocramius interesting. he is following me.
15:29
@Daniel what do you mean ?
I mean that my allergies are really annoying today, lol.
@Daniel heh, you don't say :sneeze:
@ircmaxell rackspace guy
:sneeze: :stuffy: :zzz:!
yeah, i can relate to that, whenever i come into a contact with someone both stupid and ignorant, it cause this violent allergic reaction .. professional help is being sought
@tereško that's not allergy, it's a normal chemical reaction
"corrosion"
15:44
hai to all
i have some doubt in php, my question is: i have one form, in that form have some fields like firstname, lastname, and resume upload, in that resume upload file move to upload folder, and form values are inserted into db, i did these process, then i need the upload folder protected by username and password, these upload resumes are uploaded in that upload folder using these username and password, without username and password cant upload the files, is it possible masters?
lol
yes it is possible
that is also possibly the longest run on sentence / question I've seen in quite a while.
Dammit, modelling XML schema is hard
@Daniel u have any reference links, kindly send me i am new to php
@karthys I don't think someone asking questions about PHP here a year ago is new to PHP.
15:59
spamming escape() calls all over the views. Oooooh, why didnt I use XML in the first place?
"While 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."
16:28
Please enlighten me...going off what you are saying, and just make sure I am reading your message correctly, how should the whole echo statement be written? — user2335979 1 min ago
Are they devs or .... what!?
16:51
they see themselves as "hackers" , who are trying to solve real problems
@tereško problems they think to be real?
@kaᵠ very nice. Thank you.
Hey everyone - im developing a website in PHP but when i upload stuff to the site it sometimes take a lot of time before i can see it? how can this be?
user895378
@SimonPertersen Your question is impossibly vague and unanswerable in its current form.
okay in my day time i work in .net and we build websites here is it the same with a project in php?
17:03
+1 "This allows conversion back and forth between boolean and string values." That would have been also the case if FALSE were converted instead to "0". But, I guess, that would be too consistent, and PHP always tries hard to surprise the programmer. — leonbloy Jan 10 at 15:02
^^ lol
17:25
@SimonPertersen caching
17:54
@Gordon it aint browser caching could it be caching on the server?
@SimonPertersen do all changes have same type of "delay" ?
comparing updates in css/js VS changes in content
yeah its also css and javascript updates
wat .. are all types of updates delayed for the same amount of time ?!
hello
The strike is already over?
i'm cleaning up
My first BOUNTYYYYYYYYYY !
8
Q: United Kingdom (GB) postal code validation without regex

Tiberiu-Ionuț StanI have tried several regexes and still some valid postal codes sometimes get rejected. Searching the internet, Wikipedia and SO, I could only find regex validation solutions. Is there a validation method which does not use regex? In any language, I guess it would be easy to port. I supose the ...

18:32
is there a simple way to get either the first 300 chars without cutting off a word, or the first 3 sentesnes seperated by [.?!]
@MosheK Take a look at this stackoverflow.com/q/15705059
1
Q: This regex is cutting off the last word in the string even though strlen is within acceptable range

RegEdit$theExcerpt = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis' $theExcerptAppend = (strlen($theExcerpt) > 156) ? '...' : ''; $theExcerpt = preg_replace('/\s+?(\S+)?$/', '', substr($theExce...

19:02
@DaveRandom My unicorns' herd just voted against your proposal.
19:24
Dynamic typing is probably impossible without reflection.
I'm looking for a seasoned PHP dev to record a course on security for us. Pays well! Tweet me if you have the skills. :)
@joshbroton @ircmaxell Interested, Anthony? Let me know. :)
/me isn't sure what to think
ehh .. i would ask "how much"
because there should be a good price for associating with that site
especially with that dumb-as-brick community that they have there
if it needs to be a good price, I don't want to associate with it
I don't mind "dumb" communities as you put it
.. there is that too
but is that community really that bad
@ircmaxell the issue that you open any of the worst articles in that site, and first 20 comments (if not all) will contain "omg, this is awesome, great article"
19:34
it's no w3schools
I don't mind if those are the worst articles
I mind if all the articles are like that
good writers are different from people who understand the topic
and a good writer can make the reader feel like he was tought something good, even if it was garbage
and you can't hold that against those who are learning
Given a URL on WinXP, is there no native way to create a new local copy from it while cruisin' around in explorer? I know I can [Save As], but then I need to re-navigate to the location I already have open in explorer.
Like, if you [Open] a file in most any application, you can open a URL, and (I'm guessing via IE's libs) it'll grab a copy and put it in "temporary internet files", and open the temp copy.
Something like that.
Essentially, the aforementioned [Open] functionality, except piped into a local file in the location of my choosing.
@ircmaxell usually why good books and good manuals are written by two people, one who understands the subject, and one who is a generally good writer
@Baba needs a
@ircmaxell too bad we can do that since its on bounty
20:05
I flagged it
that is new
if you flag it .. can it still be closed ?
A mod can, like @Gordon
did you create that code from scratch as well? Or did you find that somewhere?
That is good .. never knew
@ircmaxell Nope .. took your last advice and wrote it from scratch
never seen it or used it before
I'd recommend for things like this pulling from standards
@ircmaxell yes u did
20:08
if you want to answer questions like that, learn about things like SCP: cse.msu.edu/~alexliu/publications/Cookie/cookie.pdf
@ircmaxell then i'll delete right away
I hope you know the OP does not want to use SSL ?
A Secure Cookie Protocol still uses SSL ?
No, the rest is decent
Oh ok
Deleted anyway
since you don't approve
undelete
really ?
cool
20:13
I would just recommend not putting that code in there, unless it's based on a published standard/RFC/paper, or if it's based on strong knowledge of the underlying systems
user1596138
This isn't exactly a php question.... But in mysql I created a php script using OUTFILE'and now I can't find it. Does anyone know why I just can't find it?
@ircmaxell Oh ok ....
@JosiahSouth Not 100% sure, but It creates the file in "/var/lib/mysql/<database_name>" reference
I would modify the question in a moment
user1596138
@NickFury Which is what I've tried to do.
20:17
@Baba substr($_COOKIE[$name], 0, 3) === ! $this->prifix ???
user1596138
@NickFury Maybe it isn't installed on the root of the server? Any way to find out in phpmyadmin?
user1596138
Shit. I'm looking on the server with phpmyadmin installed. I don't know where mysql is...
@NikiC if the 3 characters are a "falsy" value, 000
actually, no, that's always false
@JosiahSouth you might want to check the path via ssh.
20:19
@NickFury you must be using ubuntu
@NikiC wait ....... just saw that
only ubuntu would store database file where libraries should be kept
user1596138
@NickFury That's one of my issues with our hosting company. No SSH access.
user1596138
Plus, they're a local group and they have absolutely no idea what they're doing.
user1596138
@tereško and the directory would be different on windows?
20:21
@tereško guilty as charged.
it should be if (substr($_COOKIE[$name], 0, 3) !== $this->prefix)
user1596138
I know this thing is running Windows Server 2008, SP2. That's about the extent of my knowledge on it (And the hosting companies lmao).
@JosiahSouth that directory would be different on any there linux distro or other unix-like OSes : usually under something like /var/db
user1596138
I wish I had a ubuntu server to work off of.
user1596138
@tereško Windows though.
20:22
@NikiC thanks
on windows the default location will most likely be in program files
also .. installing mysql server on windows is somewhat bad idea to begin with
user1596138
If I can get a printout of phpinfo() I should be able to find out where mysql is. But how would I do that. They don't have anything setup, and phpmyadmin has the phpinfo() link disabled.
@webarto Do they know why the plane crashed?
@NikiC `If the class does not descend from pthreads then standard php manipulation of objects takes place, pthreads is nothing to do with it (doesn't handle anything), suggesting if no handler is set then php hasn't set one because it is not required. The object handlers are an external api on top of zend, so extension developers can control their objects behaviour, where they are not set, zend uses the default means ...

All classes are duplicated for every context, regardless of their ascent.`
user1596138
info.php still exists somewhere in phpmyadmins directory though, right? Couldn't I just go to it directly?
20:24
@JosiahSouth uhh change hosting?
@NikiC is that true
user1596138
@NickFury I've been begging the boss man to change.
@Baba I couldn't tell, because I don't understand what he's saying...
@NickFury I think cargo shift in mid takeoff (from comments). Many folks from where I am (Bosnia) work in Afghanistan (in Bagram), good salaries.
20:27
@ircmaxell Further more "Secure Cookie Protocol" is a gross misuse of cryptography because it is more secure and easier to use a simple cryptographic nonce as a cookie. If you keep up on the news you'll have heard about the asp.net oracle padding vulnerability which shows that you can gain remote code execution on some web apps because of this misuse of cryptography. "Complexity is the worst enemy of security" --Bruce Schneier — Rook Mar 29 '11 at 1:18
Was type hinting available in PHP back in '11?
I think Rook got a point
he does
and I agree that the premise of the question is what is flawed
I.e. that putting stuff in a cookie, whether you try to sign it, or try to encrypt it, is always an unnecessary risk
20:30
he does but the question is clear
How to protect session id and cookies without using SSL/HTTPS?
Without SSL
@NikiC not at all. The unnecessary risk is not using SSL
@ircmaxell Why? His suggestion to use a cryptographic nonce seems a lot more sane than that spooky secure cookie protocol
@teresko This must be like the third time you have edited a question of mine. What did you edit here? — I am John Galt 18 mins ago
@NikiC the SCP is defined and has been studied to some extent
@ircmaxell Does it offer any advantages though?
20:33
It attempts to (by deriving keys for each session, it prevents key brute forcing attacks that can be present in other signed systems)
Since when can you brute force a (reasonably large, cryptographic) key?
since always
really? how?
and there are faster than brute force attacks on key spaces depending on the algorithm...
it's slow, but it's 100% possible
user1596138
Again, not a php question.... But somehow I have to find out where mysql is installed. I have CL access to mysql, not just phpmyadmin.
20:38
@ircmaxell So it is practically possible to brute-force a (256)^16 = 2^128 key?
@NikiC yes its possible .. did that yesterday
with hashcat on my AMD CrossFireX 890GX
user1596138
I use \s for status of the server and it reads that Connection: [my host**] via TCP/IP
@Baba huh?
user1596138
So am I using some sort of gateway?
what did you brute-force?
20:41
@NikiC testing self authenticating licencing system
Its a known fact
@Baba You'll have to do a bit more explaining
@NikiC do you use hashcat ?
no, and I don't see what it has to do with this
@NikiC practically, no. But there are attacks for some implementations of ciphers that can be attacked in far less than brute forcing
@ircmaxell In any case, I wouldn't put something encrypted in a cookie in any case, simply because there is too much potential for (programmer) error.
I was reffering to Rook's suggestion to use a nonce
What practical issues are there with that?
20:44
@NikiC Because that is exactly what is was designed for
Apart from a compromised randomness source or plain stupidity (like generating tokens using mt_rand)
@Baba I think you are misunderstanding something. I was referring to brute forcing a 16-byte key. I am about 700000% sure that you did not do that yesterday.
Because if you did, I'm sure it would be on TV today ;)
Not that I have a TV of course, so maybe it actually was
@NikiC lol .....
@NikiC There are tons of applications live today using that right now
29 mins ago, by webarto
http://www.liveleak.com/view?i=c32_1367332518
20:48
@ircmaxell I'm sure there are
I'm not saying it's insecure. I'm saying that I would not trust myself to implement something like this
And that I still fail to see what's wrong with the trivial approach ^^
@NikiC I'm not saying you shoudl ;-)
Or to say it differently: Why implement a complex system, if a simple one will also do?
because there are benefits to the complex one
such as no backend storage requirements
@ircmaxell how much of a benefit is that?
very significant
20:53
why?
scale
reducing backend writes is key
you don't need particularly many backend writes for that though, do you?
especially considering the remaining website usage behavior

« first day (927 days earlier)      last day (4246 days later) »