« first day (1782 days earlier)      last day (3181 days later) » 

7:07 AM
moin
 
moin
 
@PeeHaa You're the reason I finally added github.com/sebastianbergmann/phpunit/commit/… ;-)
8
 
posted on September 02, 2015 by nlecointre

/* by Eucly2 */

 
7:26 AM
@ircmaxell now I did. ;-)
 
morning!
 
Morning, I am trying to add some more colors to my vim theme for PHP files. Are there vim users here? Currently I am using: paste.ee/p/9n4l9 that .vimrc file not that much but I would like to extend it so I have colors while coding.
 
igbinary is in a poor state for 7
 
I do but I have never tried changing syntax highlighting
 
has anyone got an apache env running something other than php ?
 
7:41 AM
I just have no highlighting currently. :( It's all plain text.
 
I need to know what happens when you push it too hard, where it faults/hangs/goes wrong ...
 
@JoeWatkins Yes, why?
 
Hi guys. I have a link which not working while redirecting to another link on live server.
 
can you make it crash for me and give me a backtrace ?
I can use ab to bring apache down with php loaded, start server, find a process, load in gdb, start using ab to push it harder and harder until it crashes your process, then "back" ... I wanna see that ...
 
@ShivaramMahapatro that seems unfortunate
 
7:46 AM
Just with lots of requests? It's running something using cgi that I would have to modify, but let's see..
 
thank you
 
I have a checkout link, which works perfectly, but after that clicking submit button i want to be url like checkout/review

RewriteRule checkout/review/$ review.php
 
White testing with aerys, only ab crashed. ^^
 
I have a checkout link, which works perfectly, but after that clicking submit button i want to be url like checkout/review

RewriteRule checkout/review/$ review.php
 
@kelunik yeah that can happen ... if you've got lots of processes you might want to check error.log because it might not crash the proc you are debugging ...
it seems when apache comes under serious load it sends hangup to workers, or blocks on accept(), I just need to know if it behaves the same elsewhere when no php is involved
 
7:54 AM
Thanks. I need to check the error log.
 
hi
do don'ts with wordpress plugin , Please tell me
???????????
 
don't = it's wordpress.. reason enough!
 
Anonymous
8:10 AM
monings o/
 
Just a question about git; If I do a git pull --rebase will it erase the modification i've done on my branch ?
 
@Baldráni if your modifications are committed, just create a temporary branch and try out git pull --rebase
 
They are
 
only possibility of you changes being erased is if you erase it in a merge conflict
 
Then suppose I do the rebase
And I push; my commit will be pushed ?
 
8:21 AM
don't rebase master
or develop
or any branch that a team collaborates on
 
I'm not on master, I'm on a specific branch created from master
 
yes your commit will be pushed, but if it's not the first time you're pushing to the branch, you will need to force push and it will rewrite the history of the branch. Plus other devs who are pulling from the branch will get conflicts. If not other dev is working on it, you are safe.
 
Ok ty :)
 
Abe
morning o/
 
Anonymous
@Abe \o
 
8:42 AM
I'd like to be able to save the content of a variable on each iteration in a for loop to a text file
 
user5020521
does anybody know a way to add a partial record into a database table?
 
@JoeWatkins Can't get that shit Apache to work with CGI currently on my local machine, works fine in the Docker container.. did you try to crash Apache with some static files or does that not work?
 
not able to do that with one machine
 
I'll try with mod_tcl and a simple sleep this later, currently traveling with mobile internet connection.
 
Abe
@bwoebi news about by value/by ref?
 
user5020521
8:58 AM
@Naruto do you know how to add a partial record into a database table using php pdo?
 
@kelunik okay cool, thanks ;)
 
@Abe \o
 
what's the best way to format a var_dump() from a variable?
make it human readable
 
@dimoff are you dumping an array?
use : echo '<pre>'; print_r($array); echo '</pre>';
Looks better than everything else
Btw; does anyone know, how i declare that a string is not case sensitive?
 
There's no way to declare a string as case insensitive in PHP. Some functions have case-insensitive options or counter-parts.
 
9:11 AM
Hm, okay. But thank you
 
I need to work on an ext hosted by sourceforge ... every fibre of my being is telling me not to do that ... but what to do ?
 
Fork it to github, then work on it
 
listen to every fibre
 
@sguetsch I don't like it, still. I'm getting conversations with many properties and will be giving it to a non-technical person, so it has to look pretty
 
@Riccardo990 what do you mean?
 
9:21 AM
@dimoff why are you giving a var_dump to a non-technical person?
 
user5020521
@Naruto I mean to allow a user to insert a new record into a database table letting him choose whether or not to fill in all of the form
 
user5020521
@Naruto have I been clear enough this time?
 
@PaulCrovella Won't. I need to prettify this thing. Already used <pre> and don't like it, still
This is what it looks like:
 
@dimoff Prettify it for what purpose?
 
The problem is I don't know what I want it to look like
 
It's thousands of email conversations
he wants it exported
 
@dimoff What are you trying to achieve?
 
@Gordon Stop trying to make link clicking happen. It's not going to happen.
 
@PaulCrovella did you click yesterday?
 
@Gordon Nope.
 
9:28 AM
@Riccardo990 Just make a full insert and make sure you allow columns to be null?
 
@PaulCrovella that is … disappointing
 
Fool me once, shame on you. Fool me twice, shame on me.
 
@VeeeneX Make it look nice. Cannot define nice, though
just experimenting with diff. formatting
 
@dimoff print_r?
 
@PaulCrovella I agree the first one was very horrible and none of the others can ever be better than the original, but yesterday and today is actually bearable.
 
9:32 AM
@dimoff Assuming you mean "export" as in export to a human readable document (rather than backup), I'd suggest not trying to shortcut with print_r or similar and creating a proper view (I'd probably look at forum / messenger style display to display conversations)
 
9:46 AM
0
Q: AJAX / PHP voting system: Content not updating on first click

AspergerTESTING ENVIRONMENT: Windows 8 using the tool XAMMP. PHP and Mysql are up to date. MY KNOWLEDGE: Starter. QUESTION: I can't get the updated content immediately after the first click, only after the second, which can become pretty nasty considering I have two kind of buttons for my little vo...

Well new question. Thought maybe someone knows some AJAX. I added a lot of info so would appreciate some insight.
 
@Asperger Try to prevent MySQL Injection with prepared queries.
 
I will. I forgot to do so, thank you.
I might as well give up on ajax if I cant fix this. If it is too advanced that is.
 
user5020521
@Naruto do you need pastebin code???
 
user5020521
@Naruto do you mean to change values into the table and for instance to set name to null so that it can be left empty am I right???
 
@Asperger So you're still having the same problem as your last question and decided to post a new one rather than improve the original?
 
9:54 AM
@PaulCrovella a moderator told me to create a better question next time so I did. I will adhere to the standard you see now. Far more informative
 
user5020521
10:21 AM
this is a validation which prevents the user from adding a partial record to a database table :
 
user5020521
$prov = isset($_POST['prov']) ?
trim($_POST['prov']) : '';
if (empty($prov)) {
$error[] = urlencode('Please select a county.');
}
 
user5020521
the if tells that when a variable is empty the user is warned to enter the value
 
user5020521
as a matter of fact I want to let the user free to add either a complete or a partial record so what do I need to change within this validation array?
 
@Riccardo990 If you need validation then use respect/validation
 
user5020521
@VeeeneX I tried to set the name column to null
 
10:25 AM
And?
 
Yo
 
user5020521
and the array still prevents the user from not filling all of the form
 
user5020521
as a matter of fact either you fill in the form or you can't add anything
 
user5020521
so the problem is this kind of validation and I'd rather change it than just replace cause I am sure that the solution lies in the array itself
 
user5020521
may I simply need to change the if condition ? @VeeeneX what do think of just if not empty?
 
Anonymous
10:32 AM
@ircmaxell o/
 
user895378
@LeviMorrison on the 14th :)
 
user895378
I think I literally walked 10 miles yesterday looking at apartments
 
10:49 AM
@rdlowrey it happens with all of us :)
 
user5020521
if(empty($var)) means that a variable must not be empty am I right?
 
user5020521
if(empty($var)) then $error[] = please enter something
 
@ircmaxell Updating PR 1397 to throw TypeError if zend_parse_parameters() fails. AFAIK there aren't any other functions that do this yet so I'm not able to "learn by example". :) Wondering if a new flag should be created for zend_parse_parameters_ex() (currently only ZEND_PARSE_PARAMS_QUIET) that would throw a TypeError when it fails. Something like ZEND_PARSE_PARAMS_TYPE_ERROR. Does that sound like the right path? :)
 
Hey @JoeWatkins! Thanks for the tip! :)
 
10:59 AM
welcome
 
@marcio The good thing: currently everything still targets master branch…
 
@rdlowrey found somewhere new yet ?
 
@rdlowrey so… not having a home == great for your fitness? :-D
 
@Ocramius hey do you think it's a good idea to add ImmutableCollection in Doctrine/Collections repo? just for the sake of reusing it in projects that use doctrine orm and don't want to return mutable collections
 
11:21 AM
morning
 
morning
 
11:33 AM
moin
 
@SammyK Hey, nice work. Seems like this had one lengthy discussion ;)
 
@Sherif Thanks! Yes, it's been quite a topic of discussion in internals for sure. :)
 
12:00 PM
@SammyK ehm… doesn't that happen automatically (in strict mode obviously)?
 
@bwoebi zend_parse_parameters_throw() is what I was looking for. :)
 
posted on September 02, 2015 by nlecointre

/* by DoubleD */

 
@SammyK so, you want to throw in non-strict mode too?
I thought that only was supposed to happen in constructors...?
 
@bwoebi Yeah, that's what this whole debate has been about. :)
I believe the random_*() functions will be the first-ever core PHP functions to throw exceptions if the RFC passes :)
 
@SammyK oh, talking about random_*() API… fine.
@SammyK intdiv.
 
12:08 PM
@bwoebi Doh! :)
 
@nikita2206 it's kinda impossible to do if you use the ArrayAccess API
 
@ircmaxell Updated the PR to match your RFC :)
 
@Ocramius you just need to fail offsetSet with an exception…?
 
o/ guys, php.net/manual/en/function.file-put-contents.php says that when a file doesn't excist, the file is created, but I get a warning: failed to open stream: No such file or directory, am I missing something here?
 
@Naruto Maybe permissions?
 
12:18 PM
@VeeeneX yes, just wanted to add that, permissions on the folder are 777
AMG, scratch what I just said, I haz found my error
god, I'm retarded
 
can someone hel me to put this in a legit variable?
$text = "<textarea name='txtbox' width= 400 height= 200>" print_r($doppelt2,true) "</textarea>";
 
@bwoebi shouldn't be in the API in first place, tbh
but yeah, guess tradeoffs
 
@Asperger people simply skip that long question
 
for now, the simplest stance is to not implement something just because we can
 
@NullPoiиteя what do you mean?
 
12:30 PM
759
Q: Warlords of Documentation: A Proposed Expansion of Stack Overflow

Kevin MontroseIt’s been 7 years and 10,000,000+ Questions since Stack Overflow was launched. The amount of good that has been done for the field - all the developers helped, all the person-hours saved, all the beginners who grew into professionals - is hard to overstate. I cannot express how proud I am of what...

3
Sign up for the beta NAOW!
 
I'm convinced the real motivation here is the fear that people might start reading documentation and SO's traffic would tank. — Paul Crovella yesterday
 
@PaulCrovella that will never happen because people are people
 
Exactly, so what's the point?
 
fun, moar reputation, the thrills of participating in a beta and who knows, maybe we get some swag
 
If it came with the promise of a RTFM close reason for SO questions I might be interested.
 
12:35 PM
@PaulCrovella yeah, that's step 2 :-D
Also, it allows people, when asking questions to see a link to docs pop up… (before sending)
 
Hey, can I write a variable mixed with HTML and PHP?
 
@Asperger very long question makes it hard to answer because we dont have much spare times
 
like $var = "<textarea name='txtbox' width= 400 height= 200>",print_r($doppelt2,true),"</textarea>";

It works with echo, but this won't work
 
@sguetsch use . instead of ,
 
@Ocramius I'm not really suggesting ImmutableCollection to even implmenet Collection interface. Because obviously Collection has methods that ImmutableCollection shouldn't have at all, ArrayAccess methods being one of them
 
12:38 PM
@Gordon damn :D thank you
 
@sguetsch yw
 
@Gordon looks nice but hope it will going to end up being very good
 
@sguetsch the reason , works with echo is because echo is a language construct. think of it as echo ("foo", 42, "bar") just that you are not using the parenthesis
 
@nikita2206 yeah, and the area is cloudy and requires lots of insights
I'd rather pick up @LeviMorrison's work than keep working on doctrine/collections
 
12:41 PM
@Ocramius algorithms repo? I'm afraid it doesn't contain structures
Oh another one, I see
 
@SebastianBergmann lol!
Does that mean I have to drop the handle I use everywhere and people know now though?
Can somebody confirm that the "bug" felipe fixed here was not actually a bug and the "fix" is totally strange? bugs.php.net/bug.php?id=53319
 
@PeeHaa sounds like a dubious honor :-P
 
That fix made <br> and <br/> different in terms of alloweb tags in strip_tags which to me is just plain stupid
@bwoebi Yeah and kinda silly :)
If you care about it you should let people sign off on commits
Which is something I actually have been thinking about, but not sure whether that is annoying for contributors
 
@PeeHaa Wait, so if one form is set to allowed the other is still stripped? Yes, that's incredibly stupid.
 
12:56 PM
@PaulCrovella I have the strong feeling that felipe totally interpreted that bug wrong and for some reason OP thought it fixed his issue without checking
Unless I am missing something here
 
well it's a crappy bug report anyway - the expected/actual results should have, I dunno, the expected and actual results
rather than an ambiguous summary
 
^ jup…
 
Imo the bug report should have resulted in a doc update to make it clear we just expect plain tags e.g. <br> instead somebody went in and updated php-src instead is how I see it
What should I do now? Send mail to internals? Felipe? Open a bug report?
Re-open the bug report?
 
submit a PR removing the function
 
@PeeHaa open a report. a new one.
@PaulCrovella haha… :-P
 
1:01 PM
@PaulCrovella lol that would indeed solve it :P
@bwoebi k tnx
 
@Sherif do you still need me with the docs?
 
WTF!? O.0
It's even worse than I suspected!?
The docs are actually correct...
That is fucked up
Ugggghhh wtf this makes no sense like at all
 
@Tyrael btw. you probably want to grant @marcio some Zend karma…
 
@PeeHaa I wasn't entirely joking in my suggestion.
 
I see that now :)
 
1:10 PM
@PeeHaa o_O
 
@bwoebi I might ask you help somewhere today / tomorrow to help fix this mess
 
Abe
> strip_tags() no longer strips self-closing XHTML tags unless the self-closing XHTML tag is also given in allowable_tags.
seems it was intentionally changed to behave like that
 
@Abe Which is exactly where this clusterfuck started
read that line again
And now tell me whether that sentence makes any sense at all
 
Abe
there must be a reason, no?
 
Yes drunk coding :P
 
1:12 PM
read it like five more times. slowly.
 
@Abe And yes read it again
 
@Abe Oh there's always a reason. In this case, drugs and alcohol were probably involved
 
Abe
lol
 
hold on, I just found a new way to parse that in my head: no longer (strips self-closing XHTML tags unless the self-closing XHTML tag is also given in allowable_tags.)
 
Abe
wait. what? it doesn't make sense
> In PHP 5.3.4 and later, you will also need to include the self-closing XHTML tag to strip these from str. For example, to strip both <br> and <br/>, you should use:
 
1:15 PM
@Abe lol morning ;-)
 
Abe
omg
i wasn't paying attention @PeeHaa
 
strip_tags removes HTML tags. Unless they're self closing XHTML tags. If you have self closing XHTML tags you have to tell us NOT to strip them so that we know to strip them
 
Abe
i'm so happy that i use dom for this kind of things...
 
Yeah, I'm sticking with "nuke it from orbit."
 
Hey at least I get the chance to actually go look in php-src and try to make myself useful for once
 
Abe
1:16 PM
how did that happen? and someone documented it too
 
@Abe The commit that does that (kinda) tried to fix a bug report
 
Abe
what the fucking fuck
 
I'm amazed phpwtf.org hasn't noticed yet
 
@Machavity lol, wth
 
@Ocramius Rephrasing this gem which came from here
 
Abe
1:25 PM
@PeeHaa since you are there, what about improving the function, too?
strip_tags($str, '<div class id><p class id>', $keepAttributesOnAllowableTags = true)
 
@marcio @marcio any reason why you requested your account with a different email address which was used as the author for your commits?
 
@Tyrael I think that was more or less resolved
 
Abe
$string = 'foo<div onclick=""></div>baz';
echo strip_tags($string, '<div class>'); // foo<div onclick=""></div>baz
echo strip_tags($string, '<div class>', false); // foo<div></div>baz
@PeeHaa ^
 
for marcio.web2@gmail.com I can't see any commits merged, for marcio3w@gmail.com I can see more than enough to reward an account
 
@Abe stop giving PHP more things to do badly
 
1:28 PM
but technically anybody could claim to be you and request an account on your behalf using a different email
 
@Abe That looks like something that could go wrong easily
 
@Sherif ok, thanks
 
As in: I ain't gonna touch that
 
Abe
@PaulCrovella ... that's absolutely needed for it to not be useless at all
if i allow <div> doesn't mean i want to allow <div onclick>
hence the list of safe attributes...
 
@Abe What you are looking for is a real HTML sanitizer, not strip_tags
 
Abe
1:30 PM
14 mins ago, by Abe
i'm so happy that i use dom for this kind of things...
 
in addition, the function isn't strip_attributes
 
ok people. I think I got it
It's actually not that bad and somewhat correct
 
Abe
@PaulCrovella it is a threat to security. i would strip all attributes unless specified in allowable tags
 
4 mins ago, by PeeHaa
@Abe What you are looking for is a real HTML sanitizer, not strip_tags
 
The only thing that is actually happening is that self closing tags in allowed_tags are ignored
 
Abe
1:34 PM
@Tyrael excuse me if i borrow your avatar
...
 
feel free
 
lol
 
you should also check out my blog background/header image: tyrael.hu
 
Abe
@PaulCrovella are you serious? not just me but nearly the totality of people think that using that will prevent script injection. which does not
 
@Abe huh?
 
1:36 PM
/me pokes head in
 
Abe
i am fine with my dom solution, but don't get surprised if people say php sucks
 
@PeeHaa This has nothing to do with a handle such as your GitHub username. It just makes sure that your real name and email address are attached to your commits.
 
@Abe maybe you missed my suggestion
36 mins ago, by Paul Crovella
submit a PR removing the function
 
Abe
@PeeHaa not necessarily Billy Silly knows that strip_tags($baz, "<div>") is a threat to security, since it doesn't strip "onstuff" attributes
 
@Abe It never says it does that on the box
Can we all agree that the only thing that is happening is that: 1) self closing tags are ignored in allowable_tags and 2) the person who updated the docs was drunk?
 
Abe
1:38 PM
i would change it in php 7 @PeeHaa
strip_tags($baz, "<div>") strips all the attributes on div, unless explicitly specified strip_tags($baz, "<div id class rel>")
 
@Abe It strip tags and if you say "no don't strip that tag" it should be obvious attributes also stay
Because well the entire tag stays
 
xkcd Survey http://xkcd.com/1572/ http://m.xkcd.com/1572/ http://t.co/ofjcZ5senq
 
@SebastianBergmann What is there to be gained (unless you also let me sign off)?
 
Abe
@PeeHaa again, people think it they will be safe with that
 
@Abe and there's a big red warning box in the documentation saying the attributes will stay, and that those can be abused
 
1:41 PM
@Abe Do you have evidence for that?
A couple of SO posts or a github search
 
@Gordon I accidentally submitted the form while filling out the "mash your keyboard" box.
 
Abe
@PaulCrovella yes, by why not make the function behave better, since peehaa is fixing it and it's broken anyway
@PeeHaa it's a guess knowing the average php user
 
@Abe It's actually not
5 mins ago, by PeeHaa
Can we all agree that the only thing that is happening is that: 1) self closing tags are ignored in allowable_tags and 2) the person who updated the docs was drunk?
 
@PaulCrovella lol
 
Abe
@PeeHaa ok. fine, we are not communicating :P
 
1:44 PM
So if I just update the docs stating self closing tags are ignored and remove the drunk talk it should be fine
@Abe :)
 
@Gordon it was shortly after adobe bridge opened and all my windows minimized... I don't even know what keyboard shortcuts those are
 
Abe
i'm saying that regardless of the fact it's currently broken, the function could behave better and offer more functionality @PeeHaa
 
@Tyrael Hi. Thanks for noticing this. I'd prefer to use the same email from the commit credentials.
 
@Abe I don't agree that making a function do something it is not meant to do is making it better
 
@PeeHaa Just add a bool $do_something_different = false and it's fine
 
Abe
1:48 PM
i see that part of that function; a currently missing functionality
 
I think you mean $dont_do_something_different = true
 
@NikiC sssssssshhhhhhhhh
 
this is PHP after all
 
:)
 
@PaulCrovella Right. Best do that in a minor version
 
1:51 PM
or perhaps declare(behavior="alternate")
/me ducks
 
@PaulCrovella y u bring the 'declare' nightmare back
 
I wanted to say declare(behavior="backwards") but that would make everything sane
 
declare(behavior=predictable) // E_ERROR
6
 
@DanLugg lol
 
@PaulCrovella no, better reuse strict_types
 
1:54 PM
strict typing is done on dvorak
 
Either way thanks for merge @SebastianBergmann. I will test it in a few minutes
 
@DanLugg zend_error_noreturn(E_COMPILE_ERROR, "You seem to be trying to use a different language...");
 
@PeeHaa The gain is useful information in the output of "git log".
 
favorite question title of the day: PHP Script not work good at all
 

« first day (1782 days earlier)      last day (3181 days later) »