« first day (674 days earlier)      last day (4274 days later) » 

10:00 PM
@Lusitanian hey man.. can you help me please?
 
@daviesgeek You're already paying $5 a month for bluehost
Why not 5 a month for a VPS where you have nearly complete control?
@Letterman what exactly wiht
 
@Lusitanian VPS is that cheap?
 
google $5 vps and you'll find tens if not hundreds
 
@Lusitanian example 2 here: owasp.org/index.php/Double_Encoding
 
That article doesn't really make sense
 
10:01 PM
@Lusitanian Wow. I will have to look into that. This is the first time I've actually done "real" work on a bluehost website.
 
IF you don't trust user input you'll be fine
 
@Lusitanian "However, the web application can have a character filter which prohibits characters such as “< “, “>” and “/”, since they are used to perform web application attacks. The attacker could use a double encoding technique to bypass the filter and exploit the client’s session"
 
No
not if you use something like htmlpurifier
just prevent it by using a proper white-list based solution
 
but this is everywhere
 
@Lusitanian If I update to 5.4 on the server (which I've opened a ticket about), will any of my code be broken?
 
10:02 PM
@Letterman use htmlpurifier and you'll be okay
@daviesgeek no but a shared host probably won't do that for you
 
@Lusitanian a lot of people are mentioning this enconding as something that might be usefull
 
useful? are you trying to exploit someones site?
because if so there's no way i'm helping you :)
 
@Lusitanian Well, if they don't, I shall complain. A lot
 
lol....doesn't normally work sadly
 
@Lusitanian haha obviously not
 
10:03 PM
lol good
 
never done anything illegal on my life
 
Attacker prespective
 
@Lusitanian Eh...then I shall probably switch. My hosting is up next month.
 
The double encoding is just if you have some wacky-ass CMS which doesn't know wtf to do with input
if you always escape your output and sanitize your input you'll be okay
XSS isn't this omgshitstorm that everyone thinks it is
 
10:05 PM
@Lusitanian Yes I know htmlpurifier is a solution for me, but i'm interested in what do people mean in this encoding stuff..
 
meh
basically what they're saying is it'll get decoded to a string that's urlencoded, and it won't get recognized as a bad string by the initial filter but somewhere along the line it'll get decoded again
which really makes no sense because no software should work like that
 
I know
 
it's urlencoded
 
but here it is.... and not one and twice are mentioning this as an XSS-Methos
 
@Lusitanian Apparently I can do it from the Cpanel.
 
10:06 PM
@daviesgeek o.O, they have multiple versions? well then great
you should at least have 5.3
 
@Lusitanian Yup.
 
if they have 5.4 then go for that
 
I'm just gonna go to 5.4
 
@Lusitanian another example breakthesecurity.com/2011/12/…
 
meh
i already explained what they mean
just make sure you don't doubly decode input
without sanitizing
and always escape your output
 
10:10 PM
but why would someone do that?
 
because there are awful developers out there
 
why on earth would someone just decode his output with any reasons, just before sending it away?
 
Oh great.
That broke a section of the site
 
how so
there shouldn't have been anything you did reliant on 5.2...
 
that is one in a million mistake..... no one would ever make a big deal out of it..
 
10:12 PM
can you show me the code that broke
 
I am using an MVC model site, so I load the header, content, then footer.
 
that's not mvc
but do show me what's broken :P
 
Now, for only a section, the header/footer aren't showing up
 
Anyway i'm leaving now...... Thanks for everything
 
@Letterman Just note that some of those so called "hacks" require an already vulnerable application
 
10:13 PM
@Lusitanian Hehe...I can show you the section of code, but I doubt you'll be able to figure it out :-)
 
I.e. somebody screwed up already
 
in what way?
 
@PeeHaa what kind of mistake? where can you see that?
 
@ircmaxell i am having some trouble finding a question you answered about php->pdf convertors... there are a bunch of dups but you or someone else on that question mentioned a piece of software i wanted to take a second look at
 
10:15 PM
@Letterman Decode stuff which cannot be trusted for example and just outputting it on a page without htmlspecialchars()
 
@Lusitanian Every single page is fine except for that one.
 
why would someone decode anything twice? with no reason
 
@Letterman Not twice... once
 
@AndyPerlitch: Second
 
It gets decoded by http
 
10:16 PM
13
A: Is there a PDF parser for PHP?

ircmaxellI've written one before (for similar needs), and I can say this: Have fun. It's quite a complex task. The PDF specification is large and unwieldy. There are several methods of storing text inside of it. And the kicker is that each PDF generator is different in how it works. So while somethi...

 
@PeeHaa ok. once. why would someone decode his output just before sending it? that is one in a million chance..... not a simple mistake
 
@Lusitanian Well, I shall blame it on you. Your PHP code broke it :-D
 
@daviesgeek is that what broke it? o_O
 
I put the function at the beginning of the view and it broke it somehow.
 
lolwtf
what was the error
 
10:17 PM
@Lusitanian My thoughts exactly.
@Lusitanian No error, just that the header/footer didn't load, and consequently the CSS/JS as well.
 
Well, you probably don't have display_errors on
set it to on before running or defining the func and see the error
 
The middle content view loaded just fine though
 
ini_set('display_errors', true);
 
@Lusitanian Yup. You are right. I did forget that I'd turned that off earlier
Still no errors...I set display_errors to On
 
o.o
doesn't really make sense
are you sure the change to 5.4 pushed thru?
 
10:20 PM
Yah. No sense at all.
 
@PeeHaa anyway i'm going now. please do write a short explanation (on my post stackoverflow.com/questions/12044342/…) why this method is mentioned in a lot of places. thanks a lot!
 
@Lusitanian Lemme see.
According to phpinfo(); it is now at 5.4.5. According to php --version at the CLI, it has some problems loading something...
Failed loading /usr/lib64/php/modules/ioncube_loader_lin.so
Failed loading /usr/lib64/php/modules/ZendOptimizer.so:
 
ZendOptimizer
still exists?
 
<b>Fatal error</b>:  Directive 'allow_call_time_pass_reference' is no longer available in PHP in <b>Unknown</b> on line <b>0</b><br />
 
sigh
 
10:22 PM
@Lusitanian Yes?
 
hm
where are you using a call time pass by reference
 
function name(&$var) you must
 
@Lusitanian I don't use it, AFAIK
 
@webarto is yoda
 
@Lusitanian I searched the entire site. Nowhere do I find references to it, except in php.ini
 
10:23 PM
that's really weird
well, a call-time pass by ref looks like this:
 
do_something(&$myvariable);
@webarto lolling
 
@Lusitanian I found it in one place...
Two, to be exact, but one is FPDF, which I'm not using anymore...
So what do I do? I didn't write the framework that this runs on...
My boss did
 
a cat just showed up at my doorstep
where is it used?
/ can i see the func call
 
@Lusitanian in a function...JAS.
 
10:28 PM
JAS?
 
@Lusitanian Just A Second. :-)
 
that's not a call time pass by reference
that's a reference as a function argument which is okay
 
@Lusitanian Oh. I guess I didn't understand what you meant.
 
10:30 PM
call time is when you're calling a function and add an '&' before a var
 
@Lusitanian Oh, so I should search for "&$"
 
no, you should serach for that as part of a method call
rather than a method definition
the one you found was part of a method definition
 
@Lusitanian Yes, but how would I search the entire site for an instance of a call time pass by reference?
 
search all your files for &$ and then weed out the method definitions
 
@Lusitanian okay. What about a foreach loop?
 
10:32 PM
that's fine
it's just method/func calls where this applies
 
k, that's the only time I see this show up besides in a method definition.
 
then that makes no sense :O
 
Failed loading /usr/lib64/php/modules/ioncube_loader_lin.so:  /usr/lib64/php/modules/ioncube_loader_lin.so: undefined symbol: php_body_write
SourceGuardian requires Zend Engine API version 220060519.
The Zend Engine API version 220100525 which is installed, is newer.
Contact Inovica Ltd. at sourceguardian.com for a later version of SourceGuardian.

Failed loading /usr/lib64/php/modules/ZendOptimizer.so:  /usr/lib64/php/modules/ZendOptimizer.so: undefined symbol: zend_throw_exception_internal
^^ There is the entire error ^^
 
Well you may be having issues because of that ioncube crap
 
Okay. I just removed that...
Still giving me the error
 
10:35 PM
what is the command you aer running btw
 
@Lusitanian php --version
 
oh, well if you're not running any of your own code than that doesn't apply to your code...
 
Before, it just returned the PHP version and patch.
 
that's why it's Unknown, it's not running your code
so that's weird
some extension mismatch, did you disable the zend optimizer as well
 
@Lusitanian Yah, but what's weird is that php --version doesn't even tell me anything about PHP. It just gives the error.
 
10:36 PM
that's because it's a fatal error
 
@Lusitanian I didn't see it in the options...
 
this is probably some issue with your host
 
Okay, I did find zend optimizer at the end of the php.ini file
zend_extension=/usr/lib64/php/modules/ioncube_loader_lin.so
zend_extension=/usr/lib64/php/modules/ixed.lin
zend_extension=/usr/lib64/php/modules/ZendOptimizer.so
 
yeah, remove all of that
then try
 
Hmm..still throws the error
 
10:39 PM
that's bizarre
 
Ah ha! I did figure out the error that your code is having....
 
> Honestly, I stopped understanding what this whole discussion is about around ~100 mails ago.
Agreed, @NikiC.
 
Why would you do that? What's the advantage? Lemme guess that just made it OOP? ;-) — PeeHaa 32 secs ago
 
I forgot that the php.ini file in the subdirectory is not the one to change. I needed to change the one at www/
 
10:41 PM
later all
 
Darn. There are a bunch of errors.
 
with what
 
Much of the important code
 
o_O
 
Non-static method DB::getConnection() should not be called statically in
 
10:43 PM
-____-
that one's on you and or your boss :P
that shouldn't have worked in 5.2 either...
also you shouldn't be using a singleton
 
I've never got these errors before.
Also, the server that runs other sites on this framework is running PHP 5.3
 
@Lusitanian I don't think it is me. I switched back to 5.2 and the errors are all gone
 
well there's something in your code that's not compatible with 5.4 :P
which seemed unlikely to me
 
@Lusitanian And 5.3
And I can't really be dealing with this now...
:-(
@LeviMorrison Thanks. Will check it out.
 
10:48 PM
meh, so just do it later
anyway the only reason you needed 5.4 was for the short array syntax i was using
just replace it with array() instead of []
 
Well, I can see that magic quotes has been removed. I know that is used somewhere..
@Lusitanian Where?
 
Wherever i use the [ ] syntax in that function
i don't remembre, just know i did
 
@Lusitanian Yes. You used it below the function. I only copied the function over, since I didn't need the rest...
 
the function itself used it too i thought
 
Wait. That's not going to break it...
Okay. Here are the errors your code is throwing.
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in ...views/adminApplications.php on line 26
And:
Fatal error: Cannot redeclare search_nested_array() (previously declared in ...views/adminApplications.php:23) in ...views/adminApplications.php on line 23
 
10:52 PM
that's not my fault, again
you're declaring the function twice that means
as far as the first part, i'd need to see the call being made
 
@Lusitanian Nope. I just searched for it.
 
yes you are. you're including the file twice then
 
@Lusitanian Oh right!!!!! I put the function in a foreach loop. facepalm
Okay. Fine now...
sigh
I hate it when stuff like that happens and it is a tiny little mistake...
 
declaring a function in a foreach loop is pretty hard to do accidentally :P
 
What does $mysqli->fetch() do? Is it similar to fetch_array and fetch_object?
 
10:55 PM
@Lusitanian Yes, but it was an "accidental" paste into the code.
That's where I was working, so I pasted it in there...
 
@ircmaxell was afk for a while, thanks for finding that for me!
 
However, it still doesn't like a line of the code:
throw new \InvalidArgumentException('Expected array of at least size 1 for needle');
 
get rid of the "\"
that requires php 5.3
 
@Lusitanian Ah...
 
it's because i assumed it'd be part of namespaced code
 
10:57 PM
All good now.
@Lusitanian Ah
 
It seems like fetch() would just return the data from a MySQL database. I know fetch_array returns an array while fetch_object returns an object.
 
@ircmaxell i cant believe it. that is actually not the question i was thinking of... im pretty sure there is another one where you list off libs like FPDF, DOMPDF, etc. you or another user also mentioned one paid tool, one that recently allowed conversion of css3 effects
 
Okay @Lusitanian I got an invalidargumentexception error
 
what's your function call?
 
@Lusitanian $key = search_nested_array($app['id'], $data['readCount'])
 
11:01 PM
did you look at my example? ;)
the first argument needs to be an array of what you're searching for
and it's giving you the value in return, not the key
if i recall
search_nested_array( array('Application ID' => $app['id'], $data['readCount']) );
or whatever the field name is
 
@Lusitanian Oh. The first argument is a number...
 
it's kinda like a mongo query
you need to specify the field name
along with the value you want
 
Ah. I see.
 
i should get to sleep
soon
=/
 
@Lusitanian The value? As in what I am searching for?
 
11:03 PM
yes
i gave you examples with the function! :P
 
@Lusitanian Except I can't use them, remember?
 
The only difference is the array syntax...
array() vs []
The concept is still exactly the same
 
Okay. Well your function works great. It actually works better than what I was trying to do before. Thank you!
 
heh, did it work?
you're welcome :)
 
@Lusitanian Yup. Amid my stupidity and misunderstanding, it does work now. :-)
Wow. And all that to get a little bit of text to display.....
 
11:06 PM
lol, good. hehe
 
But a very important little bit of text, I must add...
@Lusitanian How do I get a count of an array?
 
count($array)
 
Actually, I need the count of an array where the value of 'Read' = 1
 
say-wha
 
Hey guys, I have a quick question. I'm building a blackjack game in php. I have my deck stored in an array like so $cards = array (
"2c", "2d", "2h", "2s", "3c", "3d", "3h", "3s", "4c", "4d", "4h", "4s", "5c", "5d", "5h", "5s",
"6c", "6d", "6h", "6s", "7c", "7d", "7h", "7s", "8c", "8d", "8h", "8s", "9c", "9d", "9h", "9s",
"10c", "10d", "10h", "10s", "jc", "jd", "jh", "js", "qc", "qd", "qh", "qs", "kc", "kd", "kh", "ks",
"ac", "ad", "ah", "as"

); and I'm in the middle of doing a calculate score function and I can't see where it's going wrong.
function calculateScore ($arrOfCards){
$total = 0;
foreach($arrOfCards as $card){
switch($card){
case ($card == 'j');
$total += 10;
break;
case ($card =='q');
$total += 10;
break;
case ($card =='k');
$total += 10;
break;
case ($card =='2');
$total += 2;
break;
case ($card =='3');
$total += 3;
break;
case ($card =='4');
$total += 4;
break;
case ($card =='5');
$total += 5;
break;
case ($card =='6');
$total += 6;
break;
case ($card =='7');
$total += 7;
break;
case ($card =='8');
$total += 8;
break;
Any ideas would be greatly appreciated.
Sorry for the big block of code.
 
11:15 PM
Array
(
    [0] => Array
        (
            [User ID] => 19
            [Application ID] => 43
            [Read] => 1
        )

    [1] => Array
        (
            [User ID] => 19
            [Application ID] => 9
            [Read] => 1
        )

    [2] => Array
        (
            [User ID] => 19
            [Application ID] => 1000
            [Read] => 1
        )

)
My array.
@Lusitanian Now what I want is the count of ones where 'Read' = 1
 
so just modify my function so instead of searching for one array given the criteria
it searches for all of them
then count the result set
but i gotta go now
 
I know that right now, none of these have 0, but they will later.
 
will help moar if you need later
 
@Lusitanian Ah. Okay.
@Lusitanian kk. I may actually just do that part in SQL.
 
this switch made me cry
 
11:19 PM
I'm sorry it did that. It wasn't my intention. Very new to all of this and trying to get my head around it. Any reason in particular it made you cry? That I can fix?
 
@webarto ?
 
11:35 PM
@AndyPerlitch search then, dunno what else to say
 
Everybody who is using SEChatModifications here, what do you think about this pull request?
 
@ircmaxell how dare you not have an indexed knowledge of all 900+ questions you have answered... :D
 
11:59 PM
Is this a bug?
 
CRAAAAAAAAAP
 
@ircmaxell ?
 
I just accidentally booked a non-refundable hotel for the wrong night
5
 

« first day (674 days earlier)      last day (4274 days later) »