HtmlPurifier AutoParagraph + Html.Allowed - htmlpurifier

please help me understand what I'm doing wrong. I'm trying to use HtmlPurifier with a Html.Allowed whitelist, but the results are just messed up.
Here is an example of Html.Allowed disabled – everything works as expected. Now I set a whitelist containing all used tags (span, p, ul, li) and HtmlPurifier throws warnings and returns an unexpected result, see here.
I have spent hours trying to find my mistake. Any help is much appreciated!
David

It's a bug. If you add 'div' to your Allowed list, you will have the desired effect.
It has been fixed in:
commit 0680832d41d4d5377ea3ea8d8c10fd574d2deb7e
Author: Edward Z. Yang
Date: Tue May 21 17:19:59 2013 -0700
Use info_parent_def to get parent information, since it may not be present in info array.
Signed-off-by: Edward Z. Yang

Related

Error on one page that does not appear anywhere else

Hi so my wordpress site has just started acting up, I am not sure if its an update that has caused this but only on this one page I am getting this error regarding
Notice: Array to string conversion in /customers/c/1/7/veganantics.co.uk/httpd.www/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/StoreApi/Schemas/ImageAttachmentSchema.php on line 95
I can't seem to find the issue, I have tried replacing the file with a new core file and the error is still there, would really appreciate some help
This is the page: https://veganantics.co.uk/vegan-gifts/
Thank you
Ash
The theme, a plugin or some custom code is probably using the wp_calculate_image_sizes filter and returning an array instead of a string.
Do a text search on your install and look for wp_calculate_image_sizes. The function that you need to find will look similar to
add_filter('wp_calculate_image_sizes', 'something');
Explanation:
ImageAttachmentSchema.php on line 95 is calling wp_get_attachment_image_sizes which must be a string.
wp_get_attachment_image_sizes is returning wp_calculate_image_sizes( $size_array, $image_src, $image_meta, $attachment_id ) which again must be a string.
wp_calculate_image_sizes returns a filtered value, and that's the only place where such an error (array instead of a string) can happen. So, if the filter incorrectly returns an array, it bubbles up to the function that you see in the error log.

Accessing objects in an array

Newbie here! This is actually an update to this issue; I'm attempting to access a specific element, hoping someone can help me. I'll include the code and what it logs to the console:
console.log(nextProps.filterSliderApplied);
what is logged to the console
What I'm trying to reference, even with just a print to the console, are currentVal, min, or max (so 20, 2, or 177932, respectively) . I've tried using various Objects methods, but I can't seem to isolate the individual elements. Any direction would really be appreciated. Thank you!!
I actually figured this out quite some time ago and forgot to post an answer; basically, i needed to reference the key:
<Slider
defaultValue={filterSliderApplied[key].currentVal}
min={filterSliderApplied[key].min}
max={filterSliderApplied[key].max}
/>
There's a lot of other code involved, but this allowed me to directly access each value I was trying to target.

Filter out text-only spams

I have been getting these spam emails that are just text and the spam filter can't seem to do anything about it. I'm trying to come up with a regular expression that can possibly catch these spams. Below is couple samples. I would very much like to hear ideas on how to filter out these nuisance spams that the spam filter can't seem to filter out.
The spams contains just texts and there does not seem to be any particular pattern that I can see. There is always links, of course. But, no discernible pattern I can see. Love to hear ideas on how to filter something like this.
=======================
CBS Report - There are 3 so called “health foods” you should NEVER eat
See them > http://www.cielcardenst.com/881j8x6386eIrTb65xkMhhxvKaFgOUqZtzMhff05/buzzwords-stroker
These are foods that are being marketed to you as super foods for your health.
If you're serious about regaining your health and energy, I urge you to
watch every second of this brief presentation I've made to help you do
just that
Full Story > http://www.cielcardenst.com/881j8x6386eIrTb65xkMhhxvKaFgOUqZtzMhff05/buzzwords-stroker
All statements above are an-ad
go here to end
http://www.cielcardenst.com/af78s6s3x8Y6f_b65KkMhhxvKaFgOUqZtzMhfb45/buzzwords-stroker
218 E. Bearss Ave. , Ste. 203, Tampa, FL 33613
Discard your email from our database by submitting your name here
http://www.cielcardenst.com/chooses-concretes/9908S9j3870ib65ZkMhhxvKaFgOUqZtzMhf2f1
Eleanor Dimaria / 3308 Lovell Ct Las Vegas Nv 89121-3733
resolute that Dalzell was forced to give ground. As he slowly retreated and shifted, Jetson drove in more impetuously than ever. Midshipman Dan found himself at last in a position of advantage. Now, hammer him, Danny advised; Farley,
nerve-energy, was now just the least bit confused. Dan landed on one ear, and then against his enemys chin. Both were hard, dazing blows, though neither left a mark. Then an uppercut and Dalzell landed on Jetsons jugular. With, a gasp the fellow went down to the floor. One, two, three, four Hepson began counting. Dont bother
right soon, broke in Dan Dalzell eagerly. Joyce had already stepped into the room, leaving the door open. Now, as though by instinct, the midshipmen seemed aware that the O.C., who to-day happened to be Lieutenant Cotton, U.S.N., was standing in front of the doorway gazing in. Instantly the middies came to the position of
attention, looking straight ahead of them. Good evening, gentlemen, greeted the O.C. Is anything unusual going onWe have been discussing the football situation, sir, announced Midshipman Hepson quite truthfully. Had Hepson been asked if there had recently been a fight in progress he would have answered truthfully, but he
===================================
Did You See What Drastic Things This Mom Did To Her Face? (Photos Included In Article)
Doctors around the world are angry that THIS mother posted her simple facelift trick online.
(She is 55 but now looks 33)
Only 5 complimentary samples are left.
Please HURRY and read her exclusive story here
http://www.clintoscraziness.com/begotten-breakaway/936E8o634bBNb2imMjjywKbFiOVsav0Mjh1a6
You may stop by going below
http://www.clintoscraziness.com/5edR8m6sk34cKb2MmMjjywKbFiOVsav0Mjhb9d/multi-triplets
Or by writing to PO Box 26383 2700 Louisiana Ave. S. Minneapolis, MN 55426
Take off your account from our listing
by confirming your information http://www.clintoscraziness.com/pertaining-Westfield/31eu89sy3v-4dXb2EmMjjywKbFiOVsav0Mjh14e this way
35 Yosemite Dr Cherokee Village Ar 72529-5219

Unable to get date xAxis working with unix timestamp

I am having some trouble understanding the Anychart axis documentation.
Using this example https://jsfiddle.net/gvb29tc2/2/ i have some data points i want to plot using the unix date stamp for x-axis.
[
1497786600, // <- ID
'Sun Jun 18 2017 19:53:35 GMT+0800 (SGT)', // <- date
1497786815630, // <- unix date
...
]
I select it using x: new Date([2]), but i cant get it to display. Just outputs a single vertical line. Also, i wanted the major tick on 5min and minor on 2min. Can't get that working either.
Since all i am trying is a simple line chart, i think i'm missing something stupid. Can someone explain where i'm going wrong please ?
You shouldn't use any functions in mapping settings.
Right way is
x:[2]
After that you can work with mapped value as timestamp
https://jsfiddle.net/gvb29tc2/4/

After adding snippit of code to default/setting.php bombarded by header warnings

I'm quite aware this question has been asked before multiple times, but I have no idea how to deal with this in my specfic situation. All I did was modify the default/settings.php file in order for the toolbar drawer in drupal to support more shortcuts.
I inserted the following code in the bottom of the document:
/**
* Changing Max Shortcut Slots
*
* The shortcut module supports a total of seven shortcuts slots. To change
* the quantity of supported enabled shortcuts the 'shortcut_max_slots' must be
* modified accordingly.
*
* #see https://www.drupal.org/documentation/modules/shortcut
*/
$conf['shortcut_max_slots'] = 11;
Well I got it to work, which is good, but I'm assaulted by a barrage of warnings, each one stating the following:
Warning: Cannot modify header information - headers already sent by (output started at /home/adamdcco/public_html/hadarc.com/cms/sites/default/settings.php:1) in drupal_send_headers() (line 1221 of /home/adamdcco/public_html/hadarc.com/cms/includes/bootstrap.inc).
I'm lost, I looked into the bootstrap file and navigated to the specficed line and, unfortunately no lightbulb. Sorry I'm new :), but I did search around, before being utterly overwhelmed
Any and all help is appreciated :P
Well than looks like we're good :)
I searched around some more and came across this question/answer
How to fix "Headers already sent" error in PHP , in a nutshell it's the same question, amazing answer, so yeah just in case anyone cared the code I inputted:
$conf['shortcut_max_slots'] = 11;
should of had quotes around the eleven, and any extra spaces in the beginning and in the end of the file had to be removed. Live and Learn :)

Resources