HTML Purifier Special Character Encodings - htmlpurifier

I was wondering how can I stop html purifier from turning my & signs to & and into & instead?

It should be fine to str_replace & into & after the purification.

Related

How to escape escape "=" or Equal to sign in batch script in a double quote string

SET "gmail5=https://mail.google.com/mail/u/5/?tab=wm&ogbl#inbox"
echo %gmail5%
The output is
H:\local\CODE\Batch scripting\powershell\Config>.\test.bat
H:\local\CODE\Batch scripting\powershell\Config>SET "gmail5=https://mail.google.com/mail/u/5/?tab=wm&ogbl#inbox"
H:\local\CODE\Batch scripting\powershell\Config>echo https://mail.google.com/mail/u/5/?tab=wm & ogbl#inbox
https://mail.google.com/mail/u/5/?tab=wm
'ogbl#inbox' is not recognized as an internal or external command,
operable program or batch file.
I checked the StackOverflow most of the post said that anything in "" is escaped along with =. I cannot figure out,why it gets recognized in echo. My use case is to use these strings in another batch script for vdesk.
vdesk create:4
vdesk on:1 run:%gmail5%
Batch uses & to separate different commands on one line. It does not assume that "..." is a string - it might be, however unlikely, that the " is a legitimate character as a command parameter.
Hence, you need to escape the & with a caret (^) which should work with all "awkward" characters except % for which the escape is % itself.
the thing you are trying to accomplish can be done in following way,your code was all right except every time when you print special characters use ^ or Cmd will confuse it for &(And) operater.
#echo off
SET "gmail5=https://mail.google.com/mail/u/5/?tab=wm^&ogbl#inbox"
echo %gmail5%
pause >nul

Add plus sign to batch file url

I have a batch file which opens a pop-up within a website. The website opens fine, but when I want to add a parameter with a plus character, +, it doesn't work!
The code looks like this:
#echo off
start "Chrome" chrome --app=https://website.com?phone=%1
However the %1 will be replaced with the incoming number but without the + before it.
I don't why that happens so I tried to add a plus manually.
#echo off
start "Chrome" chrome --app=https://website.com?phone=+%1
But that doesn't work either!
Does anyone have an idea how to add the + sign to the url?
The desired result should be:
https://website.com?phone=+3112345678
That's because + is the url encoding for space.
To encode a plus sign you have to use %2b.
But in batch-files the percent sign is also a special character, therefore it has to be escaped itself by another percent sign.
https://website.com?phone=%%2B555-123
And the url should be quoted, because when more than one get parameter is present, then these parameters are separated by & signs, that collides again with the special meaning in batch files for command separation.
start "Chrome" chrome --app="https://website.com?phone=%%2B%1&name=John"

Combining lines of code

How can i combine in my bat file
set FILESPATH1=C:\Temp\Test
set FILESPATH2=C:\Temp\Test\Bas
set FILESPATH3=C:\Temp\Test\Dennis
To one single line of code
set "FILESPATH1=C:\Temp\Test"&set "FILESPATH2=C:\Temp\Test\Bas"&set "FILESPATH3=C:\Temp\Test\Dennis"
& separates commands; the quotes are not compulsory, but ensure that the value assigned to the variable doesn't contain invisible trailing spaces.
Depending on what you want: you can use && or & between the three commands.
&& executes the command(s) on its right if the command(s) on its left succeeded but & will execute the command(s) on its right even if the command(s) on its left failed (see this link).
In your case it doesn't really matter which one you use:
set "FILESPATH1=C:\Temp\Test" & set "FILESPATH2=C:\Temp\Test\Bas" & set "FILESPATH3=C:\Temp\Test\Dennis"

understanding the For Each Loop

I'm new to scripting and programming.
In the following and similar scripts, I noticed that there exists a 'objOperatingSystem'
that is referred to in the 'For Each' loop.
I understand that 'colSettings' is a variable that contains the WMI collection, but where does the 'objOperatingSystem' come from ?
Pls help. Thanks!!!
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colSettings = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colSettings
Wscript.Echo "Available Physical Memory: " & _
objOperatingSystem.FreePhysicalMemory
Next
objOperatingSystem is a variable. For Each declared it. Basically, for every item in colSettings a variable named objOperatingSystem will be set to the current item, and the body of the for loop executed.
It's vb script. And it's looking into the operating system object thru WMI to see available memory. it's part on the winmgmts (windows management) object. Use a neat tool called WMI creator and surf all the cool wmi's on your computer. It's is just a variable created to hold the object it's looking for in WMI and then iterates thru it "for each" time.

.vimrc for C developers

There is a question How to set .vimrc for c programs?, but nothing especially interesting in there.
By what .vimrc options do you facilitate your C development in Linux? (e.g. for building, ctags, tabs...) Any ideas welcome, especially for "external building with make".
how about this?
https://mislav.net/2011/12/vim-revisited/
set nocompatible " choose no compatibility with legacy vi
syntax enable
set encoding=utf-8
set showcmd " display incomplete commands
filetype plugin indent on " load file type plugins + indentation
"" Whitespace
set nowrap " don't wrap lines
set tabstop=2 shiftwidth=2 " a tab is two spaces (or set this to 4)
set expandtab " use spaces, not tabs (optional)
set backspace=indent,eol,start " backspace through everything in insert mode
"" Searching
set hlsearch " highlight matches
set incsearch " incremental searching
set ignorecase " searches are case insensitive...
set smartcase " ... unless they contain at least one capital letter
https://github.com/jslim89/dotfiles
This is my repo. Inside already got a few type of vim plugins including c.vim, ctags, autocomplete, etc.
Along with options in plan9assembler's answer,
Run make from inside vim, you can just use :make but that won't automatically open the quickfix window with you're errors. To get that to happen, add a second :Make command [1]:
command! -nargs=* Make write | make! <args> | cwindow
Another thing I have is a recursive search for my ctags file. The following will use the tags file in the current directory, then search one directory above recursively till it finds a tag file [2]:
set tags=./tags;

Resources