« first day (2710 days earlier)      last day (2249 days later) » 

12:15 AM
I know, however, I need some time to think about a better question. You can undelete you know ;)
 
 
1 hour later…
1:30 AM
eh it's your question, I'm here only to guide, maybe banhammer if you start spamming ads
 
 
5 hours later…
6:12 AM
I'm kind of wondering, is there any advantage of using the if ( ... ) : ... endif; markup over if ( ... ) { }? I found the former extremely unfriendly, and most of the IDEs can't highlight it properly.
 
 
3 hours later…
8:42 AM
@JackJohansson, no and I think it is mostly recommended not to use that syntax. (well, I recomend, from exactly the reason you listed)
 
9:02 AM
@MarkKaplun Yes, and I can't even imagine when there are multiple nested conditionals on the above format, and the indention sucks.
 
 
2 hours later…
11:07 AM
Hello,

I have a small site by means of visitors (up to 2500 visitors a month), 10 pages, 10 images, not a mega site to be spammed frequently.

Do you think the WordFence plugin is enough do protect a CF7 default form that doesn't have a captcha?

Thank you for sharing a stance,
Please tag my profile to ensure I see your reply.
 
11:38 AM
@JackJohansson it's less intimidating to new people, but I agree, {} is better
@user9303970 I would be dubious about WordFence, it can't protect you from much, and it mostly gives that feeling of security that blinds you from actual threats. You cant fix security by installing a plugin
 
12:34 PM
Some people post You have an extra semicolon in your code as an answer, and get 5 upvotes for it.
 
@TomJNowell I humbly tell you it doesn't blind me from anything and I'm not asking on security in general (DDOS, BFA, DB injection and so forth). I'm only asking about potential spamming the particular form I mentioned - does WordFence helps with that or a captcha is needed. I ask nothing else. Anyone is welcome to share if she or he thinks it does or doesn't.
 
just stating that you can't secure a site by adding a plugin, WordFence mostly provides a false sense of security. Google doesn't show that WordFence does anything special with contact form 7
I'd add a captcha
its possible it might block spammy IPs though.. but
 
WordFence didn't even detect infection on a website that I was sure it infected @user9303970
 
a captcha will also block those things, and WordFence has to scan every incoming request slowing your site down
not to mention you'd need WP to load on each request, so caching systems are somewhat compromised as a result, especially the kind that don't touch PHP like Varnish
and if your theme has a hole in it security wise, perhaps you missed some escaping or validation somewhere, WordFence can't fix that
and some hosts actively block WordFence
@JackJohansson its probably just checking the checksums of core files
 
12:51 PM
@TomJNowell Doesn't even do that on some installations. I was seeing extra files on FTP, but no notice from WordFence
WordPress can be easily compromised if not updated. I had a highly secured VPS, no root access, no disk access, private key login, etc etc. Still my WP was compromised
Apparently some bug that allows on the fly XSS injection on UDP
Turned out it has sent over 500GB dos attacks from m VPS
 
1:12 PM
@JackJohansson sounds like a lack of nonces or escaping
 
It was a 4.7 bug, fixed after updating to 4.9
 
 
6 hours later…
7:04 PM
How do you sort an array where 10 would sort as if it were "ten"?
 
7:34 PM
Never mind, seems too complicated so I just opted out of that feature.
 
8:18 PM
@MichaelEcklund pre-process a copy of the array swapping out numbers for words, then sort both arrays, using the new array as the sort
you'll probably have to implement a custom sorting algorithm though rather than relying on PHP's internal algorithm
 
8:35 PM
too complicated. Ended up just implementing a alphanumeric pagination to filter the posts by a letter or number or range of either
 
9:03 PM
so maybe it's easier than I thought
usort is the answer
 
Yeah I don't think so
1 = One, 8 = Eight, 10 = Ten
it's fine. this pagination solves half the battle
 
9:23 PM
$f = new NumberFormatter("en", NumberFormatter::SPELLOUT);
echo $f->format(1432);
 
Is that just built into PHP core?
 
$unsorted = [ "tree",1,"cat",2,"melons",3];
$f = new NumberFormatter("en", NumberFormatter::SPELLOUT);
$formatted = array_map( function( $v ) {
	if ( is_numeric( $v ) ) {
		return $f->format( $v );
	}
	return $v;
}, $unsorted );

$final = array_combine( $unsorted, $formatted );


usort( $final, function( $a, $b ) {
	return strcmp($a, $b);
} );
something like that
5.3+
 
 
2 hours later…
11:52 PM
PhpStorm says it's not found
nevermind
but ya it's not working
 

« first day (2710 days earlier)      last day (2249 days later) »