« first day (727 days earlier)      last day (4221 days later) » 

8:00 PM
matt: ok, otherwise it looks fine. you're getting a 403 on an /admin/... page?
 
@Tarun Why don't you look at the code for Zend_Form and see for yourself?
 
@Jocelyn Good evening, you have a cv-run here, right?
 
no a 403 on every page if I remove the htacess files, even though on other servers I have never had a problem.
I cant even get in the wp-admin
 
@vascowhite looked and did not find yet,right now i am setting variable in view object from my controller class if the zend_form returns false on calling isValid method
anyway i am trying something else :)
 
8:01 PM
@hakre What is a cv-run?
 
Who flagged that cv-pls request?
 
@Tarun What about Zend_Form::getErrors()?
 
matt: ok. the other rules look ok. I don't use WP, but you might have file permission sit on the files themselves. Doesn't look like .htaccess sit.
 
@Peter thanks
 
matt: only other thing I can think of off the top of my head would be the equivalent of a VirtualHost allow/deny where you're blocked off by IP
 
@NikiC I have no clue, wondered, too. and one again.
 
Maybe someone pissed cause his question got closed, or something like that?
And I think I accidentally confirmed the flag :/
 
hey fellas
 
hey @Andy
 
@vascowhite thanks for the solution,but i am looking to use isErrors method since it has less overhead than getErrors(will iterate over all elements )
 
8:13 PM
Then add an isErrors() method to your form when you create it.
 
if I have a question about a problem that is subjective and I am just looking for input and ways in which others approach it, is code review the best place to post this?
 
@Jocelyn just joining the chat and pumping cv-pls entries in ;)
 
@vascowhite I am not rendering the whole form ,i am just rendering input elements of form using viewHelper decorator only.
 
@Tarun I don't see how that makes a difference
There is also Zend_Form_Element::getErrors()
 
lol,i did not read your previous comment,yes thats what i am doing right now
anyway back to learning, thanks @vascowhite
 
8:23 PM
@Tarun The best (only?) documentation for Zend Framework is the code and the docblocks.
 
Votes cast all time:
  544	up
3,213	down
 
Votes cast all time:
366 Up
1612 Down
 
1,222 Votes Cast
all time
1,175	up
47	down
 
8:38 PM
@ShaquinTrifonoff You're far too generous :)
 
@ShaquinTrifonoff shame on you
 
You have to let those down votes out! Holding them in will make you ill.
 
you know what they say about bottled up downvotes...
 
All that pent up negativity, can't be good for you.
 
although the numbers look a bit out of date
 
Do you save them up to post all at once?
 
@vascowhite yes, I put them in my text editor first
 
@vascowhite Heh, why did Eric Lippert upvote that one post? He would have a ration of Infinity otherwise :/
 
8:56 PM
@NikiC I was wondering that too, he's only cast 346 votes in 3 1/2 years! Also I think you meant ratio, not ration :)
@Jocelyn It's depressing to see so many at once :(
 
@vascowhite Don't be so nitpicky! :P
 
@NikiC Sorry, I'm pedantic by nature :)
 
@vascowhite close-vote or del-vote the as you think is necessary, so they get closed or even deleted ;-)
@hakre @hakre this was a big cv-run today
 
@Jocelyn I can't vote to delete yet, I need to more than double my rep for that
 
@vascowhite same for me. Too bad :-(
 
9:00 PM
whore those rep
4 delv powa
 
@Jocelyn and my next privilege at 5000 looks quite boring.
 
@vascowhite I am at 3471 points now. The next privilege is is the boring "approve tag wiki edits" privilege
 
@Jocelyn I have 4814, so I'm looking at the same one as you
 
I still have to find someone who does think this privilege is interesting
 
9:07 PM
Tag wikis are the unloved child of SO
@NikiC I should get out there and start answering those dupes!
 
My next privilege is 'Create tag synonyms'.
 
^ not yet.
 
I mean I cast my open vote
 
thx ;)
 
9:20 PM
@hakre Why?
 
@NikiC an actual question appeared.
 
ahoy hoy
 
hey @irc
how's italy?
 
incredible...
Remind me again why I don't move to Italy? Just had a mindnumbingly good risotto. And that was just the first course...
 
9:31 PM
haha
@ircmaxell meets Dolce Vita!
 
@ircmaxell , maybe you should just move to europe
1. that might not be valid claim for much longer @cyril
2. you do not have to always work in the same country you live in
 
hola all
 
user1125394
@tereško the best is probably to freelance then ;)
 
Yeah... like that will happen anytime soon...
 
you do not have to freelaance to work in a foreign country
@ircmaxell dunno ... you might be open to that idea sooner then you expect
when I say, that USA is becoming a scary place, I'm not joking
 
9:39 PM
I am open to it.
But family matters. And it would take a lot for me to move more than an hour away...
 
probably a dumb question, feel free to berate and shun and tiny-avatar me... when using a data mapper pattern, should the validation of the data being inserted or updated occur in the domain model or the data mapper?
 
Domain object
 
Or a separate validation service altogether
though @tereško disagrees with that
 
user1125394
@AndyPerlitch the data is retrived from db, it should be valid already, validated when inserted no?
 
@AndyPerlitch , the data integrity checks (like , uniqueness of email) should happen in database and DM gets only the exceptions to handle, the logical constraints should be checked in domain objects
 
9:41 PM
stackoverflow.com/questions/3714107/…, seems to be a bit out of date now.
 
@cyril right but im referring to user-inputted data, like from a form
ok
@tereško when you say "in database" you are referring to the data mapper object?
 
user1125394
ah sry nvm, a $DM->insert($validatedmodel)
 
@AndyPerlitch no, literally in the database
 
i mean in database , as in "constraints in table definition"
 
i.e. UNIQUE INDEXing emails
 
9:43 PM
ohh gotcha
oh and DM is data mapper
derr
 
the violation of that would cause an exception , which you can handle then .. for example by changing the state of data mapper which you were trying to store
 
@AndyPerlitch I'd say domain object, too, as @ircmaxell
The domain object needs to ensure that it's state is valid.
 
@AndyPerlitch interface Validatable { function isValid(); }
class DomainObject implements Validatable { function isValid() { return $this->username !== 'badusername'; } }
 
@hakre , there is no much DO can do about checking uniqueness of an email
 
ok, my followup question was if the fields of the domain object should be set to the unvalidated values first, or if validation should occur before setting those fields
@hakre but this statement pretty much answers that
 
9:46 PM
@tereško then the DO must not care about that. So what is validated here?
 
i check validity of a value in the setters , but it is actually matter of personal preference
 
Or is there some kind of domain object that represents that relation?
 
@tereško ok, i figured as much
 
@hakre DO does logic , DM does data integrity
uniqueness is integrity problem
 
thanks guys, im not worthy
 
9:48 PM
@AndyPerlitch Uh?
 
@AndyPerlitch @AndyPerlitch you can also use an external validator class or have a separate isValid() method in each DO
 
@AndyPerlitch validate the form input.
 
user1125394
so you do a
$model->validate();
$DM->read($login);
if nothing
$DM->insert($model);
 
@cyril that's kinda pointless and wrong
 
9:50 PM
what?
just the insert call is sufficient
 
ok, im thinking of not separating the validation into its own class
 
@cyril when you are trying to insert duplicate the PDO will thrown an exception and other APIs will acquire error state
 
and taking the isValid() or DO->validate()
approach
 
@AndyPerlitch it can be useful if you are creating a project with 20 contact forms
 
user1125394
9:51 PM
@tereško for mysql.. but for other dbs
 
lulwut ?
 
@cyril no?
 
@tereško "it" being a separate validation class i take it
 
@AndyPerlitch yes
 
user1125394
@tereško I imagine he is using a mysql db, but what you say can fail with nosql stuff (it will upsert on a previous login)
 
9:53 PM
so for every domain object, have a corresponding mapper and validator
 
Good evening
again
 
@cyril i am using mysql(i), i suppose you'd have to write in data-integrity logic in a data gateway for a nosql solution
 
@AndyPerlitch you need separate validator only if you are repeating same validations all over the place. In a normal application all you have is isset() checks. Besides, there already are the filter_var() methods. As for data mappers ... yes , you usually have a mapper for each domain object .. and maybe a mapper for each collection of domain objects.
 
@AndyPerlitch or have one validator class that follows a set of rules which are configured for each domain object
 
@tereško in the app im workin on now the logical validations are getting pretty complicated, ie checking price schedules for continuity and other multi-step logical checks
 
9:57 PM
@Lusitanian, the whole "validation class" IMHO smells too much like form generator scripts .. it always ends badly and the API just sucks
 
@AndyPerlitch that sounds a bit like transaction script.
 
@AndyPerlitch complexity has nothing to do with it. Validation primarily is the task of domain objects. You create separate validator instance only if you are reusing SAME validations in 3+ domain objects
 
@tereško ok that makes sense
 
another thing you have to keep in mind is that this separation is worth it only in large applications
 
@hakre isnt that more or less synonymous with procedural code
@tereško yea, definitely aware of it, but this is definitely a project that will be growing over a long period of time
 
10:02 PM
Sometimes making a comment works
Hey @vascowhite if you've read my profile description I'm new to php and mysql, this was just self taught practise for me, and i don't fully understand web terminology, but from what ive read and youve commented, are you saying i should learn PDO or MysQLi instead,and which would you personally recommend learning? — Yusaf Khaliq 7 mins ago
 
@tereško i started with active record but it was quickly becoming unwieldy
 
because active record pattern is meant for extremely simple cases with not relations between tables
it has its uses , but you have to be careful, when to use it
 
yea, thing is i was struggling with the data mapper concept until very recently and am now having to go back and refactor a bunch of sloppy, wishy-washy domain objects that access the database in inconsistent ways
 
Really, how does crap like this get an upvote?
 
well, i guess im still struggling, but before i really didnt understand what it was, period.
 
@AndyPerlitch Why? Because it's a function in that example?
 
@hakre well, to me, if a single function takes input, validates it, and updates the database, its procedural
 
user1125394
Q: a datamapper should only have very raw methods, insert, update, read, delete, or it's possible to add a insertIfNotExist?
 
The duplicate of how to get information out of arrays
 
@AndyPerlitch So a class method is procedural code, too. Right. Yes, then that is procedural. :)
 
10:12 PM
@AndyPerlitch , you ming find this post relevant
i guess @cyril might read it too .. but it might be a bit too complicated
 
I've got this Base64-encoded string, and when I decode it it looks like the encoding is wrong. Can someone decode this correctly? pastie.org/5048449
 
Improvement to mysql comment for Stack Overflow (not chat)?:
gist: mysql comment, 2012-10-12 22:14:43Z
Please, don't use `mysql_*` functions to write new code. They are no longer maintained and the community has begun [deprecation process](http://goo.gl/KJveJ). See the *[red box](http://goo.gl/GPmFd)*? Instead you should learn about [prepared statements](http://goo.gl/vn8zQ) and use either [PDO](http://php.net/pdo) or [MySQLi](http://php.net/mysqli). If you can't decide which, [this article](http://goo.gl/3gqF9) will help you. If you pick PDO, [here is good tutorial](http://goo.gl/vFWnC). Also see [Why shouldn't I use `mysql_](http://goo.gl/ycnmO)*[` functions in PHP?](http://goo.gl/ycnmO)
 
@MadaraUchiha Duplicate added.
 
@MadaraUchiha Did you try that in comment markdown? I'm pretty sure the last two links won't render right.
 
@MadaraUchiha You're missing a "the" before [deprecation process]
 
10:17 PM
... community has begun deprecation process. See the red box? Instead you should learn about prepared statements and use either PDO or MySQLi. If you can't decide which, this article will help you. If you pick PDO, here is good tutorial. Also see Why shouldn't I use mysql_* functions in PHP?
 
Seems like the auto-commenter chokes on the second * of the mysql_*
Without it it works fine
 
@MadaraUchiha It can't cope with the links embedded in an inline code section. It will render as Also see [Why shouldn't I use mysql_](goo.gl/ycnmO)*[ functions in PHP?](goo.gl/ycnmO)
 
Like this maybe:?
 
user1125394
@tereško concerning your answer , it's not clear if the $mapper->store( $list ); and the $mapper->store( $user); are the same mapper classes
 
gist: mysql comment, 2012-10-12 22:14:43Z
Please, don't use `mysql_*` functions to write new code. They are no longer maintained and the community has begun the [deprecation process](http://goo.gl/KJveJ). See the *[red box](http://goo.gl/GPmFd)*? Instead you should learn about [prepared statements](http://goo.gl/vn8zQ) and use either [PDO](http://php.net/pdo) or [MySQLi](http://php.net/mysqli). If you can't decide which, [this article](http://goo.gl/3gqF9) will help you. If you pick PDO, [here is good tutorial](http://goo.gl/vFWnC). Also see [Why shouldn't I use `mysql` functions in PHP?](http://goo.gl/ycnmO)
 
10:18 PM
@MadaraUchiha It works fine if you add the missing `.
@MadaraUchiha You can keep the second *.
 
@ShaquinTrifonoff The comment markup will work fine
But the auto-commenter plugin chokes on it
 
@cyril no , they are not the same classes , but they implement the same interface
 
@MadaraUchiha Ah.
 
user1125394
@tereško k, would be clearer if you put different names thought
 
@tereško great answer, a lot of info there.
 
10:20 PM
Can anyone help with correctly decoding the string? This is all that I can get: pastie.org/5048233
 
@ShaquinTrifonoff Where's the source string?
 
I posted it earlier too.
 
@cyril the point is to have the same names , because then you can just provide the service with a different mapper (something that maps to remote REST API instead of mysql) without changing the code
that's how polymorphism works
 
@ShaquinTrifonoff Where's it from?
 
1
Q: sql injection through php script

iLinux85I have problem with php security , I found that there is someone trying to get config.php of the vbulletin forum script for example , i have vbulletin script installed in user matt So the virtual host directory for the vbulletin forum will be :- /home/matt/public_html/forum/includes/config.ph...

 
10:33 PM
Here's a slightly unrelated, but still interesting question
We've all heard of the possibility of hijacking of sensitive information over an insecure wireless network
But do anyone know how to exactly pull it off?
My friend didn't believe me when I told him, so I decided to attempt and accept that challenge :P
 
google firesheep
someone made a POC of it, that's what made everyone so concerned about it
 
@MadaraUchiha Isn't there a firefox plugin for that? Can't remember what it is called though.
Firesheep is an extension for the Firefox web browser that uses a packet sniffer to intercept unencrypted cookies from websites such as Facebook and Twitter. As cookies are transmitted over networks, packet sniffing is used to discover identities on a sidebar displayed in the browser, and allows the user to instantly take on the log-in credentials of the user by double-clicking on the victim's name. The extension was created as a demonstration of the security risk of session hijacking vulnerabilities to users of web sites that only encrypt the login process and not the cookie(s) created...
That was it :)
@MadaraUchiha You didn't waste any time putting it to use then :)
Please, don't use mysql_* functions to write new code. They are no longer maintained and the community has begun deprecation process. See the red box? Instead you should learn about prepared statements and use either PDO or MySQLi. If you can't decide which, this article will help you. If you pick PDO, here is good tutorial. Also see Why shouldn't I use mysql_* functions in PHP?Madara Uchiha 28 mins ago
 
@vascowhite It's there, why not use it?
 
exactly :)
 
10:41 PM
Bah, firesheep could not be installed becuase it's not compatible with with firefox 15.0.1
-_-
Only works with Firefox 3
Where can I download firefox 3? :D
 
posted on October 12, 2012 by Maggie Nelson

Findery Debuts in Public Beta!

 
It relied on some other software that actually did the packet sniffing, just install that. It'll be in the docs
 
@vascowhite WinPCap
 
Already have it installed
But it says it's incompatible with Firefox 15
 
10:46 PM
Now you just have to write your own extension to use it :)
 
Or I could download FF3.6
 
Did you find it?
 
Google: You are underestimating my POWAAA!
 
lol, sorry about that
 
Are you f***ing kidding me?
Not compatible with 3.6 either
 
hmmm, my laptop has started making little clickey whirrey noises like the computers on CSI. That can't be good :(
 
@hakre Even after forcing compatibility, and even trying with teh Nightly tested, I still get the same error on FF16
 
@MadaraUchiha From the Firesheep website: Firefox: 3.6.12 or newer. 32-bit only. Firefox 4.x beta not supported.
 
@MadaraUchiha probably the 32 bit only part that's tripping you up?
 
@DaveRandom Did you manage to decode it?
 
11:00 PM
Nah, got it to work on 3.6
 
@ShaquinTrifonoff Literally just finished making the output readable: pastebin.com/h59vJVPE
 
@DaveRandom Great. Thanks!
 
@ShaquinTrifonoff Trick was just to change the eval to var_dump, the function (amongst other things) runs file_get_contents(__FILE__) and preg_match()es for /(print|sprint|echo)/
The very fact that the regex contains print|sprint tells me that whoever wrote it isnot very good.
 
I'm reading through it, it uses cURL to retrieve something from exploitdb.com...
 
Yeh not examined the result properly
Just FYI, I chucked the result through beta.phpformatter.com
 
11:07 PM
@DaveRandom I did that with the code that decodes it.
I used token_get_all to replace all random variable names with $a, $b etc.
 
I'll try it next time I'm on an insecure network
 
@ShaquinTrifonoff Definitely one of the less intelligent obfuscators I've come across, I didn't even bother to examine it properly at first, just looked for __FILE__ and concentrated on that, which very quickly led me to the regex, which gave me the answer straight away.
 
11:23 PM
Does PHP offer a PRNG with a seed?
 
@MadaraUchiha Why do you need a seed?
 
@MadaraUchiha mt_srand + mt_rand?
 
@ShaquinTrifonoff Generate the same random numbers depending on user input
@NikiC Thanks
 
@DaveRandom I stripped out chunks of code and put it on jsFiddle to see what it looks like. jsfiddle.net/EPGms
It's a fancy web shell.
 
Quick question, has anyone tried passwordcard.org/en?
Is it even that secure?
I mean, as long as we're assuming the victim isn't using some funky reading direction (such as alternating left and right, or going up, left, right, down or whatever), there aren't that many combinations
 
11:39 PM
Most people would have their passwords going straight down, under each symbol (in order?) :P
 
@ShaquinTrifonoff I can just load the page straight off no problem, I've looked at the script and it does noting until you click something so it seems to be safe.
@hakre Are you still about? I'm ready to farm this whole Excel COM thing out if you're willing/able to assist. I've been playing with it for ages and I can't get anywhere near doing something useful. All I need to do is update the value of a cell at a specific coordinate on the first sheet.
 
@DaveRandom jup, still around. recovering a vat partition from usb ;)
 
@hakre A vat partition?
 
vfat I think it is.
 
11:51 PM
@hakre I guessed :-P What happened to the drive?
 
@DaveRandom well, while I was hibernating my system I snatched it out.
Was somewhat in a hurry.
But it's only some linux usb boot system, the other files were just copies it looks like.
I wanted to try a recovery before reformatting it.
Need a nuke and boot stick right now.
 
@hakre Schoolboy error. Is it flash or a HDD?
 
@DaveRandom it's just a USB stick. The boot system was a linux live CD. Just trying if that would work at all. Getting nice success with Test Disk
It could not discover the partition but the photorec tool can recover individual files regardless.
And don't say schoolboy error ;)
 

« first day (727 days earlier)      last day (4221 days later) »