樂しい日記 2015年5月1日

2015 年 5 月 1 日 (金)

Elize Gilkyson - 洪水の前

Some of them were dreamers
And some of them were fools
Who were making plans and thinking of the future
With the energy of the innocent
They were gathering the tools
They would need to make their journey back to nature
While the sand slipped through the opening
And their hands reached for the golden ring
With their hearts they turned to each other's hearts for refuge
In the troubled years that came before the deluge

Some of them knew pleasure
And some of them knew pain
And for some of them it was only the moment that mattered
And on the brave and crazy wings of youth
They went flying around in the rain
And their feathers, once so fine, grew torn and tattered
And in the end they traded their tired wings
For the resignation that living brings
And exchanged love's bright and fragile glow
For the glitter and the rouge
And in a moment they were swept before the deluge

Let the music keep our spirits high
Let the buildings keep our children dry
Let creation reveal its secrets by and by, by and by
When the light that's lost within us reaches the sky

Some of them were angry
At the way the earth was abused
By the men who learned how to forge her beauty into power
And they struggled to protect her from them
Only to be confused
By the magnitude of her fury in the final hour
And when the sand was gone and the time arrived
In the naked dawn only a few survived
And in attempts to understand a thing so simple and so huge
Believed that they were meant to live after the deluge

Let the music keep our spirits high
Let the buildings keep our children dry
Let creation reveal it's secrets by and by, by and by
When the light that's lost within us reaches the sky

(Music and Lyrics by Jackson Browne)

コーディングのメモ - HTML Purifier

HTML Purifier は、なかなかに意固地だ。YouTube 動畫の埋め込みなんか、簡單には許してくれないのである。

コメントも「危ない」と言つて削除しちまふのである。

Yii 2 の yii\helpers\HtmlPurifier を使ふなら、こんな感じだ。

$output = \yii\helpers\HtmlPurifier::process(
        $input,
        [
            'Filter.YouTube' => true,
            'HTML.SafeIframe' => true,
            'URI.SafeIframeRegexp' => '%^(https?:)?//www\.youtube(?:-nocookie)?\.com/embed/%',
            'HTML.AllowedCommentsRegexp' => '/^\/?sec *[123]$/',
        ]
    );

ただし、Filter.YouTube は、別途、\HTMLPurifier_Filter を擴張するクラスとして定義しておく必要がある。

共有・コメント


閲覽モード 通常モード

閲覽モードとパスワードの詳細については、閲覽モードとパスワードについて をご覧下さい。