Compare commits

...

129 commits

Author SHA1 Message Date
Aravindo Wingeier
58e8a1a317
Update README.md 2021-03-27 21:44:17 +01:00
dependabot-preview[bot]
d93bbe0a7d Bump php-imap/php-imap from 3.0.28 to 3.0.30 (#113)
Bumps [php-imap/php-imap](https://github.com/barbushin/php-imap) from 3.0.28 to 3.0.30.
- [Release notes](https://github.com/barbushin/php-imap/releases)
- [Commits](https://github.com/barbushin/php-imap/compare/3.0.28...3.0.30)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-13 19:23:39 +02:00
Aravindo Wingeier
5dea6903a3
Remove sponsor 2019-10-13 19:21:29 +02:00
dependabot-preview[bot]
085a14fc77 Bump ezyang/htmlpurifier from 4.10.0 to 4.11.0 (#109)
Bumps [ezyang/htmlpurifier](https://github.com/ezyang/htmlpurifier) from 4.10.0 to 4.11.0.
- [Release notes](https://github.com/ezyang/htmlpurifier/releases)
- [Changelog](https://github.com/ezyang/htmlpurifier/blob/v4.11.0/NEWS)
- [Commits](https://github.com/ezyang/htmlpurifier/compare/v4.10.0...v4.11.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-28 21:31:54 +02:00
dependabot-preview[bot]
8b255a448a Bump php-imap/php-imap from 3.0.26 to 3.0.28 (#111)
Bumps [php-imap/php-imap](https://github.com/barbushin/php-imap) from 3.0.26 to 3.0.28.
- [Release notes](https://github.com/barbushin/php-imap/releases)
- [Commits](https://github.com/barbushin/php-imap/compare/3.0.26...3.0.28)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-28 21:31:44 +02:00
dependabot-preview[bot]
4ea6703f9a Bump php-imap/php-imap from 3.0.25 to 3.0.26 (#108)
Bumps [php-imap/php-imap](https://github.com/barbushin/php-imap) from 3.0.25 to 3.0.26.
- [Release notes](https://github.com/barbushin/php-imap/releases)
- [Commits](https://github.com/barbushin/php-imap/compare/3.0.25...3.0.26)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-06-20 09:19:01 +08:00
dependabot-preview[bot]
1db1923842 Bump php-imap/php-imap from 3.0.23 to 3.0.25 (#107)
Bumps [php-imap/php-imap](https://github.com/barbushin/php-imap) from 3.0.23 to 3.0.25.
- [Release notes](https://github.com/barbushin/php-imap/releases)
- [Commits](https://github.com/barbushin/php-imap/compare/3.0.23...3.0.25)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-06-14 12:37:10 +08:00
dependabot-preview[bot]
4867ce0393 Bump php-imap/php-imap from 3.0.21 to 3.0.23 (#106)
Bumps [php-imap/php-imap](https://github.com/barbushin/php-imap) from 3.0.21 to 3.0.23.
- [Release notes](https://github.com/barbushin/php-imap/releases)
- [Commits](https://github.com/barbushin/php-imap/compare/3.0.21...3.0.23)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-06-12 13:20:47 +08:00
dependabot-preview[bot]
547a2495d6 Bump php-imap/php-imap from 3.0.20 to 3.0.21 (#102)
Bumps [php-imap/php-imap](https://github.com/barbushin/php-imap) from 3.0.20 to 3.0.21.
- [Release notes](https://github.com/barbushin/php-imap/releases)
- [Commits](https://github.com/barbushin/php-imap/compare/3.0.20...3.0.21)
2019-06-07 08:25:45 +08:00
dependabot-preview[bot]
0b43c67238 Bump php-imap/php-imap from 3.0.17 to 3.0.20 (#101)
Bumps [php-imap/php-imap](https://github.com/barbushin/php-imap) from 3.0.17 to 3.0.20.
- [Release notes](https://github.com/barbushin/php-imap/releases)
- [Commits](https://github.com/barbushin/php-imap/compare/3.0.17...3.0.20)
2019-05-27 15:22:24 +08:00
dependabot[bot]
2033f896c2 Bump php-imap/php-imap from 3.0.16 to 3.0.17 (#98)
Bumps [php-imap/php-imap](https://github.com/barbushin/php-imap) from 3.0.16 to 3.0.17.
- [Release notes](https://github.com/barbushin/php-imap/releases)
- [Commits](https://github.com/barbushin/php-imap/compare/3.0.16...3.0.17)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-20 14:48:54 +08:00
dependabot[bot]
fa07b1fe08 Bump fightbulc/moment from 1.29.0 to 1.30.0 (#87)
Bumps [fightbulc/moment](https://github.com/fightbulc/moment.php) from 1.29.0 to 1.30.0.
- [Release notes](https://github.com/fightbulc/moment.php/releases)
- [Commits](https://github.com/fightbulc/moment.php/compare/1.29.0...1.30.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-19 21:01:32 +08:00
dependabot[bot]
ea0b0922e8 Bump php-imap/php-imap from 3.0.13 to 3.0.16 (#97)
Bumps [php-imap/php-imap](https://github.com/barbushin/php-imap) from 3.0.13 to 3.0.16.
- [Release notes](https://github.com/barbushin/php-imap/releases)
- [Commits](https://github.com/barbushin/php-imap/compare/3.0.13...3.0.16)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-19 21:01:19 +08:00
dependabot[bot]
349f822c56 Bump php-imap/php-imap from 3.0.11 to 3.0.13 (#95)
Bumps [php-imap/php-imap](https://github.com/barbushin/php-imap) from 3.0.11 to 3.0.13.
- [Release notes](https://github.com/barbushin/php-imap/releases)
- [Commits](https://github.com/barbushin/php-imap/compare/3.0.11...3.0.13)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-11 14:16:53 +07:00
dependabot[bot]
bf54a04ae6 Bump php-imap/php-imap from 3.0.10 to 3.0.11 (#93)
Bumps [php-imap/php-imap](https://github.com/barbushin/php-imap) from 3.0.10 to 3.0.11.
- [Release notes](https://github.com/barbushin/php-imap/releases)
- [Commits](https://github.com/barbushin/php-imap/compare/3.0.10...3.0.11)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-06 12:27:05 +06:30
dependabot[bot]
283f9f4d5e Bump php-imap/php-imap from 3.0.9 to 3.0.10 (#90)
Bumps [php-imap/php-imap](https://github.com/barbushin/php-imap) from 3.0.9 to 3.0.10.
- [Release notes](https://github.com/barbushin/php-imap/releases)
- [Commits](https://github.com/barbushin/php-imap/compare/3.0.9...3.0.10)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-03 18:07:36 +07:00
dependabot[bot]
986501dbd7 Bump php-imap/php-imap from 3.0.8 to 3.0.9 (#89)
Bumps [php-imap/php-imap](https://github.com/barbushin/php-imap) from 3.0.8 to 3.0.9.
- [Release notes](https://github.com/barbushin/php-imap/releases)
- [Commits](https://github.com/barbushin/php-imap/compare/3.0.8...3.0.9)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-01 12:06:27 +07:00
dependabot[bot]
6e9503b246 Bump php-imap/php-imap from 3.0.6 to 3.0.8 (#88)
Bumps [php-imap/php-imap](https://github.com/barbushin/php-imap) from 3.0.6 to 3.0.8.
- [Release notes](https://github.com/barbushin/php-imap/releases)
- [Commits](https://github.com/barbushin/php-imap/compare/3.0.6...3.0.8)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-30 12:21:15 +07:00
Aravindo Wingeier
571f070c2b
Update README.md 2019-03-28 14:47:00 +07:00
synox
1e87898610 fix #62 2019-03-11 21:34:54 +07:00
synox
e083b26829 fix error not finding $purifier 2019-03-11 21:06:32 +07:00
synox
60c2f6d537 ignore .php_cs.cache 2019-03-11 20:31:39 +07:00
synox
fa6849e4b1 cleanup template 2019-03-11 20:26:46 +07:00
synox
5ca123a9c5 rename user.php to User.php 2019-03-11 20:10:44 +07:00
synox
fed05235a4 controller cleanup 2019-03-11 20:09:26 +07:00
synox
fc03444fa1 composer update && composer upgrade 2019-03-11 20:01:07 +07:00
synox
c24beb2cdf composer update && composer upgrade 2019-03-11 19:59:53 +07:00
synox
d835806a28 move images to docs/ 2019-03-11 19:58:28 +07:00
synox
a564214373 renamed backend-libs to vendor 2019-03-11 19:58:03 +07:00
synox
8958007119 format code 2019-03-11 19:49:45 +07:00
synox
11b9216a0d fixed config 2019-03-11 19:45:22 +07:00
synox
b2e91089d3 update standards 2019-03-11 19:43:39 +07:00
synox
e6c59280e3 update standards 2019-03-11 19:43:20 +07:00
synox
d1a3ec0cce brew tap kabel/php-ext 2019-03-11 01:13:44 +07:00
Aravindo Wingeier
32edf54eda
Feature/removed router (#83)
* CHANGE: refactoring to simplify application, removed router layer
REMOVED: JSON api
* add licence info
2019-03-11 01:09:24 +07:00
synox
38e1d4fd42 CHANGE: detect missing imap extension and config error 2019-03-10 22:17:59 +07:00
synox
727c41f207 CHANGE: use local files instead of CDN 2019-03-06 22:34:32 +07:00
synox
a68567ec61 removed unused bootstrap.min.css file 2019-03-06 22:30:45 +07:00
Aravindo Wingeier
aee1356cb6
update demo url 2019-03-03 21:34:30 +07:00
Perflyst
aca05624a4 Add missing fonts (#82)
Part of #80
2019-03-02 20:32:15 +07:00
Perflyst
65f7eef107 Replace cdn with local files (#81)
Close #80
2019-03-02 16:35:39 +07:00
dependabot[bot]
998a30300a Bump fightbulc/moment from 1.26.10 to 1.29.0 (#78)
Bumps [fightbulc/moment](https://github.com/fightbulc/moment.php) from 1.26.10 to 1.29.0.
- [Release notes](https://github.com/fightbulc/moment.php/releases)
- [Commits](https://github.com/fightbulc/moment.php/compare/1.26.10...1.29.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-03 12:05:05 -10:00
dtdaft
f34ddb77a3 Update frontend.template.php (#75)
Add </div> on line 265 to be W3C ok
2019-01-11 08:05:57 -03:00
Aravindo Wingeier
e2c66139ef
Delete Jenkinsfile 2018-12-28 21:48:33 -03:00
openshiftio-launchpad
78f94d1a7e Initial commit 2018-12-26 13:42:05 +00:00
Aravindo Wingeier
e3cf96c2d4
fix #73 2018-12-25 23:12:43 -03:00
Aravindo Wingeier
074251b68d
Update README.md 2018-12-25 22:48:15 -03:00
Aravindo Wingeier
8590e36394
fix #71 find config.php automatically in current and parent directori… (#74)
* fix #71 find config.php automatically. in current and parent directories. Show error message if not found.
2018-12-25 22:45:10 -03:00
Aravindo Wingeier
320e4e68cf
Update frontend.template.php 2018-12-20 17:14:27 -03:00
Parveen Bhadoo
3ae1681486 Updates for Heroku (#68)
* Create app.json

* Update composer.json

* Update composer.lock
2018-09-20 13:44:41 -05:00
benzel
3e50b8250c Update frontend.template.php (#65) 2018-08-18 18:12:41 -05:00
benzel
1fe979b821 Fixes #63 (#64) 2018-08-12 07:19:45 -05:00
Synox
d86adfc950 Release 0.2.1, Show Date in title 2018-07-01 23:29:30 +02:00
Synox
9af257ca45 new screenshot 2018-06-24 19:46:53 +02:00
Synox
c115aa8d8d new screenshot 2018-06-24 19:46:13 +02:00
Synox
fc3183aa95 new screenshot 2018-06-24 19:45:43 +02:00
Synox
33839dd426 Merge remote-tracking branch 'github/master' 2018-06-24 19:43:39 +02:00
Synox
b98805ecc8 new screenshot 2018-06-24 19:43:34 +02:00
Aravindo Wingeier
567459626d
Feature/new layout (#59)
* go minimal!
* cleanup style
* more whitespace, more awesome
* done with new layout. Moved buttons inside message, to avoid problems with <a> containing another <a> (which is invalid).
* added support for local date. and updated libs.
* new layout
2018-06-24 19:31:04 +02:00
Synox
e4652ff62d RELEASE 0.2.0 2018-06-16 21:14:21 +02:00
Aravindo Wingeier
7d2b6eb0fb
Implement closed-by-default email list. #54 (#57)
* Implement closed-by-default email list. #54
* reload on empty page
* simple styling
2018-06-16 21:09:18 +02:00
Synox
eacc2c0f1c Merge branch 'feature/manual-refresh' 2018-06-14 19:23:31 +02:00
Synox
b1bdcbfeff switched to manual reload to allow new features 2018-06-14 19:22:53 +02:00
Synox
9dc18841fd switched to manual reload to allow new features 2018-06-14 19:20:53 +02:00
Synox
bf57aac013 switched to manual reload to allow new features 2018-06-14 19:20:53 +02:00
Synox
8f5191f5cf moved to json api 2018-06-14 19:20:53 +02:00
Synox
cac61f6ede added HasNewMessagesController 2018-06-14 19:20:53 +02:00
Synox
1aa35ba523 remove turbolinks, to allow for new features 2018-06-14 19:20:53 +02:00
Synox
3c4495f4e7 switched to manual reload to allow new features 2018-06-14 19:18:04 +02:00
Synox
aa28cec701 switched to manual reload to allow new features 2018-06-14 19:15:03 +02:00
Synox
1257f83e57 moved to json api 2018-06-14 18:57:50 +02:00
Synox
44db2432dc added HasNewMessagesController 2018-06-14 18:53:11 +02:00
Synox
a4b3d8e3ca remove turbolinks, to allow for new features 2018-06-14 18:34:29 +02:00
Synox
fd7d5121e4 detect wrong php version, helps to fix #50 2018-03-17 22:44:47 +01:00
Synox
df8559fe3b better input validation 2018-03-06 22:59:15 +01:00
Synox
cbfa9571cd fix warnings in imap_client 2018-03-06 22:43:52 +01:00
Synox
5ced6b93df refactor json api classes 2018-03-06 22:30:59 +01:00
Synox
75ed103d17 created JSON API, TODO: refactor 2018-03-06 22:21:43 +01:00
Aravindo Wingeier
33dedf0368
Feature/refactor imap client (#48)
Complete refactrtoring, goal: more OO, no if-else. Split functions into multiple files.
2018-03-03 21:33:29 +01:00
Aravindo Wingeier
8d2f592e44
Update README.md 2018-01-31 17:10:09 +01:00
Aravindo Wingeier
682fdfc28d
Update README.md 2018-01-31 13:00:31 +01:00
Aravindo Wingeier
cf26b5dc5d
Add files via upload 2018-01-31 12:58:40 +01:00
Aravindo Wingeier
021916be29
Update README.md 2018-01-31 12:54:07 +01:00
Aravindo Wingeier
69d3e539ee
Update README.md 2018-01-31 12:52:39 +01:00
Aravindo Wingeier
b8011b1364
Rename readme.md to README.md 2018-01-31 12:31:39 +01:00
Synox
3b267dd175 add demo 2018-01-24 21:16:13 +01:00
Synox
4e08141bdf Merge remote-tracking branch 'github/master'
# Conflicts:
#	CHANGELOG.md
#	src/frontend.template.php
2018-01-19 23:28:41 +01:00
Synox
2eeaaf3ddb readme 2018-01-19 23:15:11 +01:00
Synox
6572548b58 fixed bug where html in plaintext emails are interpreted as html. 2018-01-19 21:50:31 +01:00
Synox
b1de900ce4 add mail counter in title 2018-01-19 21:31:52 +01:00
Synox
71582e235d #33 improve button style 2018-01-19 20:35:48 +01:00
Aravindo Wingeier
bb938fc018
fix #34 and #32: display HTML or Text by default. (#35)
* fix #34 and #32: display HTML or Text by default.
* cleanup
2018-01-19 20:28:41 +01:00
Synox
7097c008e2 cleanup 2018-01-18 21:52:47 +01:00
Synox
9f6c762c18 fix #34 and #32: display HTML or Text by default. 2018-01-18 21:50:59 +01:00
Synox
d60228b177 format 2018-01-13 20:20:28 +01:00
Synox
315f96af4c changelog 2018-01-13 20:19:51 +01:00
Synox
94317b12cc Changed:
- make blocked_usernames configurable
- improved validation of user input
- fixed problem where only one domain is defined
2018-01-13 20:15:54 +01:00
Synox
d4f3a28eed horizontal spacing for header (from @Spegeli) 2018-01-13 14:39:52 +01:00
Synox
6ceb1cc8b2 removed word 'or' in header 2018-01-13 14:31:01 +01:00
Synox
125586506e #30 copyToClipboard button 2018-01-13 14:22:09 +01:00
Synox
003037009d #30 make all addresses lowercase 2018-01-13 14:09:40 +01:00
Synox
30a07d93fc #30 make all addresses lowercase 2018-01-13 13:55:11 +01:00
Synox
11979c0943 cleanup code 2018-01-12 23:49:03 +01:00
Synox
f1a64b260b fix: restore focus on reload 2018-01-12 23:38:56 +01:00
Synox
23bff41601 fix: keep edited username on refresh 2018-01-12 23:15:51 +01:00
Synox
1dedb7e35c show message count 2018-01-12 23:09:52 +01:00
Synox
a047b887ac Merge branch 'vanilla_php' 2018-01-12 22:29:16 +01:00
Synox
e0febe4a8b fix reloads and style 2018-01-12 22:28:57 +01:00
Aravindo Wingeier
e63e9b75f7
Merge pull request #29 from synox/vanilla_php
Rewrote to use mostly pure php. Uses Javascript only where it’s necessary. 
- Added multiple domain support (https://github.com/synox/disposable-mailbox/issues/21)
- Blacklist some usernames (https://github.com/synox/disposable-mailbox/issues/27)
2018-01-12 22:16:41 +01:00
Synox
11ac4ceef8 new screenshot 2018-01-12 22:14:05 +01:00
Synox
f8139f3f05 documented tested gmail settings 2018-01-12 22:05:27 +01:00
Synox
c66dd1d1c7 testing conf 2018-01-12 21:55:47 +01:00
Synox
1617e8c35a changelog 2018-01-12 21:46:09 +01:00
Synox
d15ff68195 update readme 2018-01-12 21:35:49 +01:00
Synox
971196f019 code cleanup 2018-01-12 20:31:15 +01:00
Synox
0697be39ff code cleanup 2018-01-12 20:30:19 +01:00
Synox
bc8253b5ac local bootstrap 2018-01-12 19:24:20 +01:00
Synox
ea6b9b7039 moved html to template file 2018-01-12 18:46:26 +01:00
Synox
f49c16d62e footer 2018-01-09 21:01:38 +01:00
Synox
589e0f5026 fix #21: multi domain support 2018-01-09 20:56:59 +01:00
Synox
84270b705a fix #27: forbid hostmaster users 2018-01-09 20:53:14 +01:00
Synox
9ef39d7eb8 simple display for single domain 2018-01-09 20:47:48 +01:00
Synox
c093d69c80 cleanup 2018-01-09 20:37:25 +01:00
Synox
afb09851f4 added dependencies 2018-01-09 20:33:42 +01:00
Synox
015b424f0d autolink and html support 2018-01-09 20:33:09 +01:00
Synox
9e36b93ec6 cleanup 2018-01-09 19:46:04 +01:00
Synox
bfa4070c56 use QUERY_STRING and show reload icon 2018-01-09 19:41:50 +01:00
Aravindo Wingeier
ff2e437138
Update index.php 2018-01-09 14:17:02 +01:00
Synox
e7f3446506 simpler version without much js, just vanilla pure simple php (with some libs) 2018-01-09 00:23:36 +01:00
601 changed files with 56322 additions and 1502 deletions

3
.gitignore vendored
View file

@ -1,2 +1,3 @@
.idea
*.patch
*.patch
.php_cs.cache

15
.php_cs.dist Normal file
View file

@ -0,0 +1,15 @@
<?php
$finder = PhpCsFixer\Finder::create()
->exclude('backend-libs')
->in('src')
;
return PhpCsFixer\Config::create()
->setRules([
'@PSR2' => true,
'lowercase_constants' => true,
'braces' => ['position_after_functions_and_oop_constructs' => 'same']
])
->setFinder($finder)
;

View file

@ -1,11 +1,53 @@
# Change Log
All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/).
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project does not adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
### Changed
- find config.php automatically in current and parent directories. Show error message if not found.
- use local CSS/JS instead of CDN
- detect missing imap extension and config error
- refactoring to simplify routing
### Removed
- JSON API (json-api.php), this feature would better fit in a separate project.
## [0.2.1] - 2018-07-01
### Breaking Changes
- added $config['locale']. See config.sample.php - you have to set it.
### Changed
- new layout & design with more whitespace and more explanations.
- Show dates in local and relative format.
## [0.2.0] - 2018-06-16
### Changed
- Show list of mails and show them only on click.
- Removed Turbolinks to allow for simpler code in new features. Add new mail alert.
- Rewrote to use mostly pure php. Uses Javascript only where its necessary.
- fixed problem where only one domain is defined
- fix: restore focus on reload
- #33 improve button style
- fixed bug where html in plaintext emails are interpreted as html.
- changed footer style
- refactored code into multiple php files.
- Requires PHP version >=7.2
- make all addresses lowercase #30
- fixed error when downloading email
### Added
- better horizontal spacing for header (from @Spegeli) and style
- improved validation of user input
- Added $config['prefer_plaintext'] = true; Prefer HTML or Text and removed toggle buttons.
- Added multiple domain support #21
- Blacklist some usernames, configurable #27
- copyToClipboard button #30
- mail counter in title
- rest api option
## [0.1.4] - 2017-04-15
### Changed

View file

@ -9,4 +9,16 @@ https://help.github.com/articles/fork-a-repo/
* *minimal features and complexity:* only implement features that are really necessary for most users
* *batteries included/No build process:* the user should only download the repo and update the config file in order to run the app.
* *no database:* the application does not have it's own database. The IMAP server is the database.
## Standards
We try to follow the following standards:
* https://github.com/php-pds/skeleton
* http://keepachangelog.com
*
## Do before pull request
* run code style fixer (https://cs.symfony.com/)
* `brew install php-cs-fixer`
* `php-cs-fixer fix`

79
README.md Normal file
View file

@ -0,0 +1,79 @@
# disposable-mailbox
[![Join the chat at https://gitter.im/synox/disposable-mailbox](https://badges.gitter.im/synox/disposable-mailbox.svg)](https://gitter.im/synox/disposable-mailbox?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
A **self-hosted** disposable mailbox service (aka trash mail) :cloud: :envelope:
**PHP is not your thing? You should try the more efficient NodeJs version:** https://github.com/synox/void-mail
-----
![Screenshot](docs/screenshot_example.png)
## Features
* Anonymous usage, generate random email addresses.
* New Mail notification. Download and delete your emails.
* Display emails as text or html with sanitization filter.
* Display emails based on one [catch-all imap mailbox](https://www.google.ch/search?q=how+to+setup+catch-all+imap+mailbox).
* Only requires PHP >=7.2 and [imap extension](http://php.net/manual/book.imap.php)
## Usage
### Requirements
* webserver with php >=7.2
* php [imap extension](http://php.net/manual/book.imap.php)
* IMAP account and a domain with [catch-all configuration](https://www.google.ch/search?q=how+to+setup+catch-all+imap+mailbox). (all emails go to one mailbox).
### Before you start :heavy_exclamation_mark:
* Subscribe to [![Join the chat at https://gitter.im/synox/disposable-mailbox](https://badges.gitter.im/synox/disposable-mailbox.svg)](https://gitter.im/synox/disposable-mailbox?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) to be notified about issues and bugfixes.
* This is **Beta** software, [there are still unsolved problems](https://github.com/synox/disposable-mailbox/issues). Contributions are welcome! :heart:
* License: **GPL-3.0**. You can modify this application and run it anywhere, charge money and show advertisement. Any forks or repacked distribution must follow the [GPL-3.0 license](https://opensource.org/licenses/GPL-3.0).
* A link to https://github.com/synox/disposable-mailbox in the footer is appreciated.
### Installation
Disposable-mailbox can be installed by copying the src directory to a webserver.
1. assure the [imap extension](http://php.net/manual/book.imap.php) is installed. The following command should not print any errors:
<?php print imap_base64("SU1BUCBleHRlbnNpb24gc2VlbXMgdG8gYmUgaW5zdGFsbGVkLiA="); ?>
2. download a [release](https://github.com/synox/disposable-mailbox/releases) or clone this repository
3. copy the files in the `src` directory to your web server (not the whole repo!).
4. rename `config.sample.php` to `config.php` and apply the imap settings. Move `config.php` to a safe location in a *parent directory* outside the `public_html`, so it is not reachable through the browser.
5. open it in your browser, check your php error log for messages.
### Build it yourself
The src directory contains all required files. If you want to update the php dependencies, you can update them yourself. You must have [composer](https://getcomposer.org/download/) installed.
Install php dependecies:
composer update
### Troubleshooting
* **IMAP Server has invalid certificate**: You might have to add `novalidate-cert` to the IMAP settings. See flags on http://php.net/manual/en/function.imap-open.php.
* **Error 500, Internal error**: Check your error log file. Add to `config.php`:
ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);
## Testing on MacOs
* brew install php
* brew tap kabel/php-ext
* brew install kabel/php-ext/php-imap
* php -S localhost:8000 -t src
## Credit :thumbsup:
This could not be possible without...
* https://github.com/barbushin/php-imap, https://github.com/gnugat-legacy/PronounceableWord, http://htmlpurifier.org/,
* https://github.com/turbolinks/turbolinks, http://tobiasahlin.com/spinkit/

5
app.json Normal file
View file

@ -0,0 +1,5 @@
{
"name": "disposable-mailbox",
"description": "self-hosted disposable email service (php) using catch-all and imap",
"repository": "https://github.com/synox/disposable-mailbox",
}

View file

@ -1,8 +1,12 @@
{
"require": {
"php-imap/php-imap": "~2.0"
},
"config": {
"vendor-dir": "src/backend-libs"
}
"require": {
"php-imap/php-imap": "*",
"php": "^7.2",
"gnugat/PronounceableWord": "*",
"ezyang/htmlpurifier": "^4.9",
"fightbulc/moment": "*"
},
"config": {
"vendor-dir": "src/vendor"
}
}

185
composer.lock generated
View file

@ -1,38 +1,186 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"hash": "18ba77805fd530e1972050e6de7cd151",
"content-hash": "357059f60b3f57be6e5f15b1df393a72",
"content-hash": "b72f82faf18e750705e7e6439460f9d6",
"packages": [
{
"name": "php-imap/php-imap",
"version": "2.0.3",
"name": "ezyang/htmlpurifier",
"version": "v4.11.0",
"source": {
"type": "git",
"url": "https://github.com/barbushin/php-imap.git",
"reference": "cc1a49a3f68090db182183c59ffbc09055d59f5b"
"url": "https://github.com/ezyang/htmlpurifier.git",
"reference": "83ab08bc1af7d808a9e0fbf024f1c24bfd73c0a7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/barbushin/php-imap/zipball/cc1a49a3f68090db182183c59ffbc09055d59f5b",
"reference": "cc1a49a3f68090db182183c59ffbc09055d59f5b",
"url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/83ab08bc1af7d808a9e0fbf024f1c24bfd73c0a7",
"reference": "83ab08bc1af7d808a9e0fbf024f1c24bfd73c0a7",
"shasum": ""
},
"require": {
"php": ">=5.2"
},
"require-dev": {
"simpletest/simpletest": "dev-master#72de02a7b80c6bb8864ef9bf66d41d2f58f826bd"
},
"type": "library",
"autoload": {
"psr-0": {
"HTMLPurifier": "library/"
},
"files": [
"library/HTMLPurifier.composer.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1-or-later"
],
"authors": [
{
"name": "Edward Z. Yang",
"email": "admin@htmlpurifier.org",
"homepage": "http://ezyang.com"
}
],
"description": "Standards compliant HTML filter written in PHP",
"homepage": "http://htmlpurifier.org/",
"keywords": [
"html"
],
"time": "2019-07-14T18:58:38+00:00"
},
{
"name": "fightbulc/moment",
"version": "1.30.0",
"source": {
"type": "git",
"url": "https://github.com/fightbulc/moment.php.git",
"reference": "2f232918b63cf37699cd692ccd1926c4a547fb32"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fightbulc/moment.php/zipball/2f232918b63cf37699cd692ccd1926c4a547fb32",
"reference": "2f232918b63cf37699cd692ccd1926c4a547fb32",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.36 || ^5.5 || ^6.5 || ^7.5"
},
"type": "library",
"autoload": {
"psr-0": {
"PhpImap": "src/"
"psr-4": {
"Moment\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD 3-Clause"
"MIT"
],
"authors": [
{
"name": "Tino Ehrich",
"role": "developer",
"email": "tino@bigpun.me"
}
],
"description": "Parse, validate, manipulate, and display dates in PHP w/ i18n support. Inspired by moment.js",
"keywords": [
"date",
"display",
"format",
"i18n",
"locale",
"manipulate",
"moment",
"parse",
"time",
"translation",
"validate"
],
"time": "2019-04-18T08:27:34+00:00"
},
{
"name": "gnugat/pronounceableword",
"version": "2.0.0",
"source": {
"type": "git",
"url": "https://github.com/gnugat-legacy/PronounceableWord.git",
"reference": "fcdc0dc39775fa625040c37003727019657d001b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/gnugat-legacy/PronounceableWord/zipball/fcdc0dc39775fa625040c37003727019657d001b",
"reference": "fcdc0dc39775fa625040c37003727019657d001b",
"shasum": ""
},
"require": {
"php": ">=5.2"
},
"type": "library",
"autoload": {
"psr-0": {
"PronounceableWord_": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Loic Chardonnet"
}
],
"description": "A light, customizable and simple library generating random and pronounceable words without using dictionaries or Markov chains.",
"homepage": "https://github.com/gnugat/PronounceableWord",
"keywords": [
"generator",
"pronounceable",
"word"
],
"abandoned": true,
"time": "2012-01-08T19:36:58+00:00"
},
{
"name": "php-imap/php-imap",
"version": "3.0.30",
"source": {
"type": "git",
"url": "https://github.com/barbushin/php-imap.git",
"reference": "15340028e27fdbe619999f4c300af2a06dd4a4f0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/barbushin/php-imap/zipball/15340028e27fdbe619999f4c300af2a06dd4a4f0",
"reference": "15340028e27fdbe619999f4c300af2a06dd4a4f0",
"shasum": ""
},
"require": {
"ext-iconv": "*",
"ext-imap": "*",
"ext-mbstring": "*",
"php": ">=5.6"
},
"require-dev": {
"phpunit/phpunit": "^5.7",
"squizlabs/php_codesniffer": "^3.4"
},
"type": "library",
"autoload": {
"psr-4": {
"PhpImap\\": "src/PhpImap"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
@ -41,14 +189,17 @@
"homepage": "http://linkedin.com/in/barbushin"
}
],
"description": "PHP class to access mailbox by POP3/IMAP/NNTP using IMAP extension",
"description": "Manage mailboxes, filter/get/delete emails in PHP (supports IMAP/POP3/NNTP)",
"homepage": "https://github.com/barbushin/php-imap",
"keywords": [
"imap",
"mail",
"php"
"mailbox",
"php",
"pop3",
"receive emails"
],
"time": "2015-09-16 07:40:39"
"time": "2019-09-07T13:44:13+00:00"
}
],
"packages-dev": [],
@ -57,6 +208,8 @@
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform": {
"php": "^7.2"
},
"platform-dev": []
}

View file

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

BIN
docs/screenshot_example.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

View file

@ -1,62 +0,0 @@
# self-hosted disposable email service
[![Join the chat at https://gitter.im/synox/disposable-mailbox](https://badges.gitter.im/synox/disposable-mailbox.svg)](https://gitter.im/synox/disposable-mailbox?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Create your own temporary email web-service by combining
* a [catch-all imap mailbox](https://www.google.ch/search?q=how+to+setup+catch-all+imap+mailbox) and
* this easy to install web-application.
A random email address is created for every user and everything is updated automatically.
Emails can also be deleted.
| ![Screenshot](screenshot.png) |
| ------------- |
## You have to know
* Use [![Join the chat at https://gitter.im/synox/disposable-mailbox](https://badges.gitter.im/synox/disposable-mailbox.svg)](https://gitter.im/synox/disposable-mailbox?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) and you will be notified about issues and bugfixes.
* This is **Beta** software, [there are still unsolved problems](https://github.com/synox/disposable-mailbox/issues). Contributions are welcome!
* License: **GPL-3.0**. You can modify this application and run it anywhere, charge money and show advertisement. Any forks or repacked distribution must follow the [GPL-3.0 license](https://opensource.org/licenses/GPL-3.0).
* A link to https://github.com/synox/disposable-mailbox in the footer is appreciated.
## Requirements
* webserver with php >=5.3.0
* php [imap extension](http://php.net/manual/book.imap.php)
* IMAP account and a domain with catch-all configuration (all emails go to one mailbox).
## Installation
1. assure the [imap extension](http://php.net/manual/book.imap.php) is installed. The following command should not print any errors:
<?php print imap_base64("SU1BUCBleHRlbnNpb24gc2VlbXMgdG8gYmUgaW5zdGFsbGVkLiA="); ?>
2. download a [release](https://github.com/synox/disposable-mailbox/releases) or clone this repository
3. copy the files in the `src` directory to your web server (not the whole repo!).
4. rename `config.sample.php` to `config.php` and apply the imap settings. Move `config.php` to a safe location outside the `public_html`.
5. edit `backend.php` and set the new path to `config.php`.
6. open it in your browser, check your php error log for messages.
## Build it yourself
The src directory contains all required files. If you want to update the php dependencies, you can update them yourself. You must have [composer](https://getcomposer.org/download/) installed.
Install php dependecies:
composer install
## Credit
This could not be possible without...
* http://angularjs.org/
* https://github.com/barbushin/php-imap
* https://github.com/gregjacobs/Autolinker.js/
* http://chancejs.com/
[![BrowserStack](browserstack.png)](https://www.browserstack.com/)
Supported by [BrowserStack](https://www.browserstack.com/), which allows us to test projects online with any browser as a service. :-)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

80
src/User.php Normal file
View file

@ -0,0 +1,80 @@
<?php
class User {
public $address;
public $username;
public $domain;
public static function get_random_address(array $domains): string {
$wordLength = rand(3, 8);
$container = new PronounceableWord_DependencyInjectionContainer();
$generator = $container->getGenerator();
$word = $generator->generateWordOfGivenLength($wordLength);
$nr = rand(51, 91);
$name = $word . $nr;
$domain = $domains[array_rand($domains)];
return "$name@$domain";
}
public function isInvalid(array $config_domains): bool {
if (empty($this->username) || empty($this->domain)) {
return true;
} elseif (!in_array($this->domain, $config_domains)) {
return true;
} else {
return false;
}
}
public static function parseDomain(string $address, array $config_blocked_usernames): User {
$clean_address = User::_clean_address($address);
$user = new User();
$user->username = User::_clean_username($clean_address, $config_blocked_usernames);
$user->domain = User::_clean_domain($clean_address);
$user->address = $user->username . '@' . $user->domain;
return $user;
}
public static function parseUsernameAndDomain(string $username, string $domain, $config_blocked_usernames): User {
$user = new User();
$user->username = User::_clean_username($username, $config_blocked_usernames);
$user->domain = User::_clean_domain($domain);
$user->address = $user->username . '@' . $user->domain;
return $user;
}
/**
* Remove illegal characters from address.
* @return string clean address
*/
private static function _clean_address(string $address) {
return strtolower(filter_var($address, FILTER_SANITIZE_EMAIL));
}
/**
* Remove illegal characters from username and remove everything after the @-sign. You may extend it if your server supports them.
*
* @return string clean username
*/
private static function _clean_username(string $address, array $config_blocked_usernames) {
$username = strtolower($address);
$username = preg_replace('/@.*$/', "", $username); // remove part after @
$username = preg_replace('/[^A-Za-z0-9_.+-]/', "", $username); // remove special characters
if (in_array($username, $config_blocked_usernames)) {
// Forbidden name!
return '';
}
return $username;
}
private static function _clean_domain(string $address) {
$username = strtolower($address);
$username = preg_replace('/^.*@/', "", $username); // remove part before @
return preg_replace('/[^A-Za-z0-9_.+-]/', "", $username); // remove special characters
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

114
src/assets/custom.css Normal file
View file

@ -0,0 +1,114 @@
html > body {
display: flex;
min-height: 100vh;
flex-direction: column;
}
#my-address {
margin-top: 0.5rem;
margin-left: 1rem;
color: black;
}
.my-address-block {
background-color: #F8F9FA;
padding: 0.5rem;
white-space: nowrap;
padding-left: 0;
margin-left: 1rem;
text-align: center;
padding-right: 0;
}
.get-new-address-col {
text-align: center;
padding: 0.5rem;
}
.email-list-item {
padding-left: 0;
padding-bottom: 0;
}
.copy-button {
font-size: 75%;
color: #808080;
cursor: pointer;
background-color: transparent;
border: 0;
border-radius: 0.25rem;
}
.copy-button:hover {
color: #fff;
background-color: #007BFF;
}
header {
/*background-color: #f9f9f9;*/
padding-bottom: 1rem;
padding-top: 1rem;
}
main {
flex: 1; /* stick footer to the bottom */
padding-top: 2rem;
padding-bottom: 2rem;
}
#language-selection {
width: 10rem;
}
footer {
padding-top: 1rem;
background-color: #eeeeee;
}
.open-collapse-button {
background-color: transparent;
width: 3rem;
}
.open-collapse-button > i {
font-size: 1.5em;
}
[aria-expanded="false"] .expand-button-closed {
display: block;
}
[aria-expanded="false"] .expand-button-opened {
display: none;
}
[aria-expanded="true"] .expand-button-closed {
display: none;
}
[aria-expanded="true"] .expand-button-opened {
display: block;
}
#new-content-avalable {
display: none;
text-align: center;
}
.email-body {
word-wrap: break-word;
}
.alert-fixed {
position: fixed;
top: 0px;
left: 0px;
width: 100%;
z-index: 9999;
border-radius: 0px;
text-align: center;
}
#address-box-edit {
margin: 1rem;
}

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 586 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,372 @@
<?xml version="1.0" standalone="no"?>
<!--
Font Awesome Free 5.0.13 by @fontawesome - https://fontawesome.com
License - https://fontawesome.com/license (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
-->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<defs>
<font id="fontawesome-free" horiz-adv-x="640">
<font-face font-family="Font Awesome 5 Free"
units-per-em="512" ascent="448"
descent="64"
font-weight="400"
font-style="Regular" />
<missing-glyph horiz-adv-x="0" />
<glyph glyph-name="address-book"
unicode="&#xF2B9;"
horiz-adv-x="448" d=" M436 288C442.6 288 448 293.4 448 300V340C448 346.6 442.6 352 436 352H416V400C416 426.5 394.5 448 368 448H48C21.5 448 0 426.5 0 400V-16C0 -42.5 21.5 -64 48 -64H368C394.5 -64 416 -42.5 416 -16V32H436C442.6 32 448 37.4 448 44V84C448 90.6 442.6 96 436 96H416V160H436C442.6 160 448 165.4 448 172V212C448 218.6 442.6 224 436 224H416V288H436zM368 -16H48V400H368V-16zM208 192C243.3 192 272 220.7 272 256S243.3 320 208 320S144 291.3 144 256S172.7 192 208 192zM118.4 64H297.6C310 64 320 72.6 320 83.2V102.4C320 134.2 289.9 160 252.8 160C242 160 234.1 152 208 152C181.1 152 174.6 160 163.2 160C126.1 160 96 134.2 96 102.4V83.2C96 72.6 106 64 118.4 64z" />
<glyph glyph-name="address-card"
unicode="&#xF2BB;"
horiz-adv-x="576" d=" M528 416H48C21.5 416 0 394.5 0 368V16C0 -10.5 21.5 -32 48 -32H528C554.5 -32 576 -10.5 576 16V368C576 394.5 554.5 416 528 416zM528 16H48V368H528V16zM208 192C243.3 192 272 220.7 272 256S243.3 320 208 320S144 291.3 144 256S172.7 192 208 192zM118.4 64H297.6C310 64 320 72.6 320 83.2V102.4C320 134.2 289.9 160 252.8 160C242 160 234.1 152 208 152C181.1 152 174.6 160 163.2 160C126.1 160 96 134.2 96 102.4V83.2C96 72.6 106 64 118.4 64zM360 128H472C476.4 128 480 131.6 480 136V152C480 156.4 476.4 160 472 160H360C355.6 160 352 156.4 352 152V136C352 131.6 355.6 128 360 128zM360 192H472C476.4 192 480 195.6 480 200V216C480 220.4 476.4 224 472 224H360C355.6 224 352 220.4 352 216V200C352 195.6 355.6 192 360 192zM360 256H472C476.4 256 480 259.6 480 264V280C480 284.4 476.4 288 472 288H360C355.6 288 352 284.4 352 280V264C352 259.6 355.6 256 360 256z" />
<glyph glyph-name="arrow-alt-circle-down"
unicode="&#xF358;"
horiz-adv-x="512" d=" M256 440C119 440 8 329 8 192S119 -56 256 -56S504 55 504 192S393 440 256 440zM256 -8C145.5 -8 56 81.5 56 192S145.5 392 256 392S456 302.5 456 192S366.5 -8 256 -8zM224 308V192H157C146.3 192 141 179.1 148.5 171.5L247.5 72.5C252.2 67.8 259.8 67.8 264.5 72.5L363.5 171.5C371.1 179.1 365.7 192 355 192H288V308C288 314.6 282.6 320 276 320H236C229.4 320 224 314.6 224 308z" />
<glyph glyph-name="arrow-alt-circle-left"
unicode="&#xF359;"
horiz-adv-x="512" d=" M8 192C8 55 119 -56 256 -56S504 55 504 192S393 440 256 440S8 329 8 192zM456 192C456 81.5 366.5 -8 256 -8S56 81.5 56 192S145.5 392 256 392S456 302.5 456 192zM384 212V172C384 165.4 378.6 160 372 160H256V93C256 82.3 243.1 77 235.5 84.5L136.5 183.5C131.8 188.2 131.8 195.8 136.5 200.5L235.5 299.5C243.1 307.1 256 301.7 256 291V224H372C378.6 224 384 218.6 384 212z" />
<glyph glyph-name="arrow-alt-circle-right"
unicode="&#xF35A;"
horiz-adv-x="512" d=" M504 192C504 329 393 440 256 440S8 329 8 192S119 -56 256 -56S504 55 504 192zM56 192C56 302.5 145.5 392 256 392S456 302.5 456 192S366.5 -8 256 -8S56 81.5 56 192zM128 172V212C128 218.6 133.4 224 140 224H256V291C256 301.7 268.9 307 276.5 299.5L375.5 200.5C380.2 195.8 380.2 188.2 375.5 183.5L276.5 84.5C268.9 76.9 256 82.3 256 93V160H140C133.4 160 128 165.4 128 172z" />
<glyph glyph-name="arrow-alt-circle-up"
unicode="&#xF35B;"
horiz-adv-x="512" d=" M256 -56C393 -56 504 55 504 192S393 440 256 440S8 329 8 192S119 -56 256 -56zM256 392C366.5 392 456 302.5 456 192S366.5 -8 256 -8S56 81.5 56 192S145.5 392 256 392zM276 64H236C229.4 64 224 69.4 224 76V192H157C146.3 192 141 204.9 148.5 212.5L247.5 311.5C252.2 316.2 259.8 316.2 264.5 311.5L363.5 212.5C371.1 204.9 365.7 192 355 192H288V76C288 69.4 282.6 64 276 64z" />
<glyph glyph-name="bell-slash"
unicode="&#xF1F6;"
horiz-adv-x="576" d=" M130.9 48C114.138 48 105.765 68.39 117.566 80.191C142.792 105.417 163.66 129.5290000000001 168.215 201.6710000000001L121.438 242.9450000000001A168.48 168.48 0 0 1 121.142 233.1430000000001C121.142 151.21 103.591 133.8510000000001 86.599 117.0650000000001C38.504 69.559 73.726 0 130.919 0H224C224 -35.346 252.654 -64 288 -64S352 -35.346 352 0H396.777L342.377 48H130.9zM288 -24C274.766 -24 264 -13.234 264 0H312C312 -13.234 301.234 -24 288 -24zM571.867 -24.553L503.936 35.018C517.04 59.136 515.4599999999999 91.336 489.404 117.0600000000001C472.415 133.8450000000001 454.858 151.2030000000001 454.858 233.1430000000001C454.858 316.1690000000001 393.9 385.2170000000001 314.391 397.9050000000001A31.848 31.848 0 0 1 320 416C320 433.673 305.673 448 288 448S256 433.673 256 416A31.848 31.848 0 0 1 261.609 397.905C220.138 391.287 183.718 369.334 158.36 338.064L36.459 444.963C31.401 449.399 23.682 448.919 19.219 443.892L3.056 425.687C-1.407 420.6600000000001 -0.925 412.988 4.134 408.553L539.542 -60.963C544.6 -65.399 552.3190000000001 -64.919 556.782 -59.892L572.945 -41.687C577.407 -36.66 576.9250000000001 -28.988 571.8670000000001 -24.553zM288 352C353.538 352 406.857 298.681 406.857 233.143C406.857 135.493 430.078 108.569 458.425 80.191C461.333 77.283 462.9979999999999 73.8630000000001 463.634 70.359L194.482 306.3880000000001C216.258 334.133 250.075 352 288 352z" />
<glyph glyph-name="bell"
unicode="&#xF0F3;"
horiz-adv-x="448" d=" M425.403 117.061C408.4140000000001 133.846 390.8570000000001 151.204 390.8570000000001 233.144C390.8570000000001 316.17 329.899 385.218 250.39 397.906A31.842999999999996 31.842999999999996 0 0 1 256 416C256 433.673 241.673 448 224 448S192 433.673 192 416A31.848 31.848 0 0 1 197.609 397.905C118.101 385.217 57.143 316.169 57.143 233.143C57.143 151.21 39.592 133.851 22.6 117.065C-25.496 69.559 9.726 0 66.919 0H160C160 -35.346 188.654 -64 224 -64C259.346 -64 288 -35.346 288 0H381.08C438.27 0 473.495 69.583 425.403 117.061zM224 -24C210.766 -24 200 -13.234 200 0H248C248 -13.234 237.234 -24 224 -24zM381.092 48H66.9C50.138 48 41.765 68.39 53.566 80.191C82.151 108.776 105.143 135.915 105.143 233.1430000000001C105.143 298.6810000000001 158.462 352 224 352S342.857 298.681 342.857 233.143C342.857 135.493 366.078 108.569 394.425 80.191C406.278 68.339 397.783 48 381.092 48z" />
<glyph glyph-name="bookmark"
unicode="&#xF02E;"
horiz-adv-x="384" d=" M336 448H48C21.49 448 0 426.51 0 400V-64L192 48L384 -64V400C384 426.51 362.51 448 336 448zM336 19.57L192 103.57L48 19.57V394A6 6 0 0 0 54 400H330C333.314 400 336 397.317 336 394.004V19.57z" />
<glyph glyph-name="building"
unicode="&#xF1AD;"
horiz-adv-x="448" d=" M128 300V340C128 346.6 133.4 352 140 352H180C186.6 352 192 346.6 192 340V300C192 293.4 186.6 288 180 288H140C133.4 288 128 293.4 128 300zM268 288H308C314.6 288 320 293.4 320 300V340C320 346.6 314.6 352 308 352H268C261.4 352 256 346.6 256 340V300C256 293.4 261.4 288 268 288zM140 192H180C186.6 192 192 197.4 192 204V244C192 250.6 186.6 256 180 256H140C133.4 256 128 250.6 128 244V204C128 197.4 133.4 192 140 192zM268 192H308C314.6 192 320 197.4 320 204V244C320 250.6 314.6 256 308 256H268C261.4 256 256 250.6 256 244V204C256 197.4 261.4 192 268 192zM192 108V148C192 154.6 186.6 160 180 160H140C133.4 160 128 154.6 128 148V108C128 101.4 133.4 96 140 96H180C186.6 96 192 101.4 192 108zM268 96H308C314.6 96 320 101.4 320 108V148C320 154.6 314.6 160 308 160H268C261.4 160 256 154.6 256 148V108C256 101.4 261.4 96 268 96zM448 -28V-64H0V-28C0 -21.4 5.4 -16 12 -16H31.5V424C31.5 437.3 42.2 448 55.5 448H392.5C405.8 448 416.5 437.3 416.5 424V-16H436C442.6 -16 448 -21.4 448 -28zM79.5 -15H192V52C192 58.6 197.4 64 204 64H244C250.6 64 256 58.6 256 52V-15H368.5V399L80 400L79.5 -15z" />
<glyph glyph-name="calendar-alt"
unicode="&#xF073;"
horiz-adv-x="448" d=" M148 160H108C101.4 160 96 165.4 96 172V212C96 218.6 101.4 224 108 224H148C154.6 224 160 218.6 160 212V172C160 165.4 154.6 160 148 160zM256 172V212C256 218.6 250.6 224 244 224H204C197.4 224 192 218.6 192 212V172C192 165.4 197.4 160 204 160H244C250.6 160 256 165.4 256 172zM352 172V212C352 218.6 346.6 224 340 224H300C293.4 224 288 218.6 288 212V172C288 165.4 293.4 160 300 160H340C346.6 160 352 165.4 352 172zM256 76V116C256 122.6 250.6 128 244 128H204C197.4 128 192 122.6 192 116V76C192 69.4 197.4 64 204 64H244C250.6 64 256 69.4 256 76zM160 76V116C160 122.6 154.6 128 148 128H108C101.4 128 96 122.6 96 116V76C96 69.4 101.4 64 108 64H148C154.6 64 160 69.4 160 76zM352 76V116C352 122.6 346.6 128 340 128H300C293.4 128 288 122.6 288 116V76C288 69.4 293.4 64 300 64H340C346.6 64 352 69.4 352 76zM448 336V-16C448 -42.5 426.5 -64 400 -64H48C21.5 -64 0 -42.5 0 -16V336C0 362.5 21.5 384 48 384H96V436C96 442.6 101.4 448 108 448H148C154.6 448 160 442.6 160 436V384H288V436C288 442.6 293.4 448 300 448H340C346.6 448 352 442.6 352 436V384H400C426.5 384 448 362.5 448 336zM400 -10V288H48V-10C48 -13.3 50.7 -16 54 -16H394C397.3 -16 400 -13.3 400 -10z" />
<glyph glyph-name="calendar-check"
unicode="&#xF274;"
horiz-adv-x="448" d=" M400 384H352V436C352 442.627 346.627 448 340 448H300C293.373 448 288 442.627 288 436V384H160V436C160 442.627 154.627 448 148 448H108C101.373 448 96 442.627 96 436V384H48C21.49 384 0 362.51 0 336V-16C0 -42.51 21.49 -64 48 -64H400C426.51 -64 448 -42.51 448 -16V336C448 362.51 426.51 384 400 384zM394 -16H54A6 6 0 0 0 48 -10V288H400V-10A6 6 0 0 0 394 -16zM341.151 184.65L198.842 43.481C194.137 38.814 186.539 38.844 181.871 43.549L106.78 119.248C102.113 123.953 102.143 131.551 106.848 136.219L129.567 158.755C134.272 163.422 141.87 163.392 146.537 158.686L190.641 114.225L301.713 224.406C306.418 229.073 314.016 229.043 318.6840000000001 224.3379999999999L341.2200000000001 201.62C345.887 196.9149999999999 345.8560000000001 189.317 341.151 184.65z" />
<glyph glyph-name="calendar-minus"
unicode="&#xF272;"
horiz-adv-x="448" d=" M124 120C117.4 120 112 125.4 112 132V156C112 162.6 117.4 168 124 168H324C330.6 168 336 162.6 336 156V132C336 125.4 330.6 120 324 120H124zM448 336V-16C448 -42.5 426.5 -64 400 -64H48C21.5 -64 0 -42.5 0 -16V336C0 362.5 21.5 384 48 384H96V436C96 442.6 101.4 448 108 448H148C154.6 448 160 442.6 160 436V384H288V436C288 442.6 293.4 448 300 448H340C346.6 448 352 442.6 352 436V384H400C426.5 384 448 362.5 448 336zM400 -10V288H48V-10C48 -13.3 50.7 -16 54 -16H394C397.3 -16 400 -13.3 400 -10z" />
<glyph glyph-name="calendar-plus"
unicode="&#xF271;"
horiz-adv-x="448" d=" M336 156V132C336 125.4 330.6 120 324 120H248V44C248 37.4 242.6 32 236 32H212C205.4 32 200 37.4 200 44V120H124C117.4 120 112 125.4 112 132V156C112 162.6 117.4 168 124 168H200V244C200 250.6 205.4 256 212 256H236C242.6 256 248 250.6 248 244V168H324C330.6 168 336 162.6 336 156zM448 336V-16C448 -42.5 426.5 -64 400 -64H48C21.5 -64 0 -42.5 0 -16V336C0 362.5 21.5 384 48 384H96V436C96 442.6 101.4 448 108 448H148C154.6 448 160 442.6 160 436V384H288V436C288 442.6 293.4 448 300 448H340C346.6 448 352 442.6 352 436V384H400C426.5 384 448 362.5 448 336zM400 -10V288H48V-10C48 -13.3 50.7 -16 54 -16H394C397.3 -16 400 -13.3 400 -10z" />
<glyph glyph-name="calendar-times"
unicode="&#xF273;"
horiz-adv-x="448" d=" M311.7 73.3L294.7 56.3C290 51.6 282.4 51.6 277.7 56.3L224 110.1L170.3 56.4C165.6 51.7 158 51.7 153.3 56.4L136.3 73.4C131.6 78.1 131.6 85.7000000000001 136.3 90.4L190 144.1L136.3 197.8C131.6 202.5 131.6 210.1 136.3 214.8L153.3 231.8C158 236.5 165.6 236.5 170.3 231.8L224 178.1L277.7 231.8C282.4 236.5 290 236.5 294.7 231.8L311.7 214.8C316.4 210.1 316.4 202.5 311.7 197.8L257.9 144L311.6 90.3C316.4 85.6 316.4 78 311.7 73.3zM448 336V-16C448 -42.5 426.5 -64 400 -64H48C21.5 -64 0 -42.5 0 -16V336C0 362.5 21.5 384 48 384H96V436C96 442.6 101.4 448 108 448H148C154.6 448 160 442.6 160 436V384H288V436C288 442.6 293.4 448 300 448H340C346.6 448 352 442.6 352 436V384H400C426.5 384 448 362.5 448 336zM400 -10V288H48V-10C48 -13.3 50.7 -16 54 -16H394C397.3 -16 400 -13.3 400 -10z" />
<glyph glyph-name="calendar"
unicode="&#xF133;"
horiz-adv-x="448" d=" M400 384H352V436C352 442.6 346.6 448 340 448H300C293.4 448 288 442.6 288 436V384H160V436C160 442.6 154.6 448 148 448H108C101.4 448 96 442.6 96 436V384H48C21.5 384 0 362.5 0 336V-16C0 -42.5 21.5 -64 48 -64H400C426.5 -64 448 -42.5 448 -16V336C448 362.5 426.5 384 400 384zM394 -16H54C50.7 -16 48 -13.3 48 -10V288H400V-10C400 -13.3 397.3 -16 394 -16z" />
<glyph glyph-name="caret-square-down"
unicode="&#xF150;"
horiz-adv-x="448" d=" M125.1 240H322.9C333.6 240 339 227 331.4 219.5L232.5 121.2C227.8 116.5 220.3 116.5 215.6 121.2L116.7 219.5C109 227 114.4 240 125.1 240zM448 368V16C448 -10.5 426.5 -32 400 -32H48C21.5 -32 0 -10.5 0 16V368C0 394.5 21.5 416 48 416H400C426.5 416 448 394.5 448 368zM400 22V362C400 365.3 397.3 368 394 368H54C50.7 368 48 365.3 48 362V22C48 18.7 50.7 16 54 16H394C397.3 16 400 18.7 400 22z" />
<glyph glyph-name="caret-square-left"
unicode="&#xF191;"
horiz-adv-x="448" d=" M272 290.9V93.1C272 82.4 259 77 251.5 84.6L153.2 183.5C148.5 188.2 148.5 195.7 153.2 200.4L251.5 299.3C259 307 272 301.6 272 290.9zM448 368V16C448 -10.5 426.5 -32 400 -32H48C21.5 -32 0 -10.5 0 16V368C0 394.5 21.5 416 48 416H400C426.5 416 448 394.5 448 368zM400 22V362C400 365.3 397.3 368 394 368H54C50.7 368 48 365.3 48 362V22C48 18.7 50.7 16 54 16H394C397.3 16 400 18.7 400 22z" />
<glyph glyph-name="caret-square-right"
unicode="&#xF152;"
horiz-adv-x="448" d=" M176 93.1V290.9C176 301.6 189 307 196.5 299.4L294.8 200.5C299.5 195.8 299.5 188.3 294.8 183.6L196.5 84.7000000000001C189 77.0000000000001 176 82.4 176 93.1zM448 368V16C448 -10.5 426.5 -32 400 -32H48C21.5 -32 0 -10.5 0 16V368C0 394.5 21.5 416 48 416H400C426.5 416 448 394.5 448 368zM400 22V362C400 365.3 397.3 368 394 368H54C50.7 368 48 365.3 48 362V22C48 18.7 50.7 16 54 16H394C397.3 16 400 18.7 400 22z" />
<glyph glyph-name="caret-square-up"
unicode="&#xF151;"
horiz-adv-x="448" d=" M322.9 144H125.1C114.4 144 109 157 116.6 164.5L215.5 262.8C220.2 267.5 227.7 267.5 232.4 262.8L331.3 164.5C339 157 333.6 144 322.9000000000001 144zM448 368V16C448 -10.5 426.5 -32 400 -32H48C21.5 -32 0 -10.5 0 16V368C0 394.5 21.5 416 48 416H400C426.5 416 448 394.5 448 368zM400 22V362C400 365.3 397.3 368 394 368H54C50.7 368 48 365.3 48 362V22C48 18.7 50.7 16 54 16H394C397.3 16 400 18.7 400 22z" />
<glyph glyph-name="chart-bar"
unicode="&#xF080;"
horiz-adv-x="512" d=" M500 48C506.6 48 512 42.6 512 36V12C512 5.4 506.6 0 500 0H12C5.4 0 0 5.4 0 12V372C0 378.6 5.4 384 12 384H36C42.6 384 48 378.6 48 372V48H500zM144 108V180C144 186.6 138.6 192 132 192H108C101.4 192 96 186.6 96 180V108C96 101.4 101.4 96 108 96H132C138.6 96 144 101.4 144 108zM240 108V308C240 314.6 234.6 320 228 320H204C197.4 320 192 314.6 192 308V108C192 101.4 197.4 96 204 96H228C234.6 96 240 101.4 240 108zM336 108V244C336 250.6 330.6 256 324 256H300C293.4 256 288 250.6 288 244V108C288 101.4 293.4 96 300 96H324C330.6 96 336 101.4 336 108zM432 108V340C432 346.6 426.6 352 420 352H396C389.4 352 384 346.6 384 340V108C384 101.4 389.4 96 396 96H420C426.6 96 432 101.4 432 108z" />
<glyph glyph-name="check-circle"
unicode="&#xF058;"
horiz-adv-x="512" d=" M256 440C119.033 440 8 328.967 8 192S119.033 -56 256 -56S504 55.033 504 192S392.967 440 256 440zM256 392C366.532 392 456 302.549 456 192C456 81.468 366.549 -8 256 -8C145.468 -8 56 81.451 56 192C56 302.532 145.451 392 256 392M396.204 261.733L373.668 284.451C369.0010000000001 289.156 361.403 289.187 356.698 284.519L215.346 144.303L155.554 204.58C150.887 209.285 143.289 209.316 138.584 204.649L115.865 182.113C111.16 177.446 111.129 169.848 115.797 165.142L206.578 73.6259999999999C211.245 68.9209999999999 218.843 68.8899999999999 223.548 73.5579999999999L396.1370000000001 244.762C400.8410000000001 249.43 400.8710000000001 257.0279999999999 396.2040000000001 261.733z" />
<glyph glyph-name="check-square"
unicode="&#xF14A;"
horiz-adv-x="448" d=" M400 416H48C21.49 416 0 394.51 0 368V16C0 -10.51 21.49 -32 48 -32H400C426.51 -32 448 -10.51 448 16V368C448 394.51 426.51 416 400 416zM400 16H48V368H400V16zM364.136 257.724L191.547 86.52C186.842 81.853 179.244 81.883 174.577 86.588L83.796 178.104C79.129 182.809 79.159 190.407 83.865 195.075L106.584 217.611C111.289 222.278 118.887 222.248 123.554 217.542L183.346 157.265L324.698 297.481C329.403 302.148 337.001 302.118 341.668 297.413L364.204 274.695C368.871 269.9890000000001 368.841 262.391 364.136 257.724z" />
<glyph glyph-name="circle"
unicode="&#xF111;"
horiz-adv-x="512" d=" M256 440C119 440 8 329 8 192S119 -56 256 -56S504 55 504 192S393 440 256 440zM256 -8C145.5 -8 56 81.5 56 192S145.5 392 256 392S456 302.5 456 192S366.5 -8 256 -8z" />
<glyph glyph-name="clipboard"
unicode="&#xF328;"
horiz-adv-x="384" d=" M336 384H256C256 419.29 227.29 448 192 448S128 419.29 128 384H48C21.49 384 0 362.51 0 336V-16C0 -42.51 21.49 -64 48 -64H336C362.51 -64 384 -42.51 384 -16V336C384 362.51 362.51 384 336 384zM330 -16H54A6 6 0 0 0 48 -10V330A6 6 0 0 0 54 336H96V300C96 293.373 101.373 288 108 288H276C282.627 288 288 293.373 288 300V336H330A6 6 0 0 0 336 330V-10A6 6 0 0 0 330 -16zM192 408C205.255 408 216 397.255 216 384S205.255 360 192 360S168 370.745 168 384S178.745 408 192 408" />
<glyph glyph-name="clock"
unicode="&#xF017;"
horiz-adv-x="512" d=" M256 440C119 440 8 329 8 192S119 -56 256 -56S504 55 504 192S393 440 256 440zM256 -8C145.5 -8 56 81.5 56 192S145.5 392 256 392S456 302.5 456 192S366.5 -8 256 -8zM317.8 96.4L232.9 158.1C229.8 160.4 228 164 228 167.8V332C228 338.6 233.4 344 240 344H272C278.6 344 284 338.6 284 332V190.3L350.8 141.7C356.2 137.8 357.3 130.3 353.4000000000001 124.9L334.6 99C330.7000000000001 93.7 323.2000000000001 92.5 317.8 96.4z" />
<glyph glyph-name="clone"
unicode="&#xF24D;"
horiz-adv-x="512" d=" M464 448H144C117.49 448 96 426.51 96 400V352H48C21.49 352 0 330.51 0 304V-16C0 -42.51 21.49 -64 48 -64H368C394.51 -64 416 -42.51 416 -16V32H464C490.51 32 512 53.49 512 80V400C512 426.51 490.51 448 464 448zM362 -16H54A6 6 0 0 0 48 -10V298A6 6 0 0 0 54 304H96V80C96 53.49 117.49 32 144 32H368V-10A6 6 0 0 0 362 -16zM458 80H150A6 6 0 0 0 144 86V394A6 6 0 0 0 150 400H458A6 6 0 0 0 464 394V86A6 6 0 0 0 458 80z" />
<glyph glyph-name="closed-captioning"
unicode="&#xF20A;"
horiz-adv-x="512" d=" M464 384H48C21.5 384 0 362.5 0 336V48C0 21.5 21.5 0 48 0H464C490.5 0 512 21.5 512 48V336C512 362.5 490.5 384 464 384zM458 48H54C50.7 48 48 50.7 48 54V330C48 333.3 50.7 336 54 336H458C461.3 336 464 333.3 464 330V54C464 50.7 461.3 48 458 48zM246.9 133.7C248.6 131.3 248.4 128.1 246.4 126C192.8 69.2 73.6 93.9 73.6 193.9C73.6 291.2 195.3 313.4 246.1 264C248.2 262 248.6 260.8 247.1 258.3L229.6 227.8C227.7 224.7 223.4 223.8 220.5 226.1C179.7 258.1 125.9 241.0000000000001 125.9 194.9C125.9 146.9 176.9 124.4 218.1 162.3C220.9 164.8 225.2 164.4 227.3 161.4L246.9 133.7000000000001zM437.3 133.7C439 131.3 438.8 128.1 436.8 126C383.2 69.1 264 93.9 264 193.9C264 291.2 385.7 313.4 436.5 264C438.6 262 439 260.8 437.5 258.3L420 227.8C418.1 224.7 413.8 223.8 410.9 226.1C370.1 258.1 316.3 241.0000000000001 316.3 194.9C316.3 146.9 367.3 124.4 408.5 162.3C411.3 164.8 415.6 164.4 417.7 161.4L437.3 133.7000000000001z" />
<glyph glyph-name="comment-alt"
unicode="&#xF27A;"
horiz-adv-x="512" d=" M448 448H64C28.7 448 0 419.3 0 384V96C0 60.7 28.7 32 64 32H160V-52C160 -59.1 165.8 -64 172 -64C174.4 -64 176.9 -63.3 179.1 -61.6L304 32H448C483.3 32 512 60.7 512 96V384C512 419.3 483.3 448 448 448zM464 96C464 87.2 456.8 80 448 80H288L275.2 70.4L208 20V80H64C55.2 80 48 87.2 48 96V384C48 392.8 55.2 400 64 400H448C456.8 400 464 392.8 464 384V96z" />
<glyph glyph-name="comment-dots"
unicode="&#xF4AD;"
horiz-adv-x="512" d=" M144 240C126.3 240 112 225.7 112 208S126.3 176 144 176S176 190.3 176 208S161.7 240 144 240zM256 240C238.3 240 224 225.7 224 208S238.3 176 256 176S288 190.3 288 208S273.7 240 256 240zM368 240C350.3 240 336 225.7 336 208S350.3 176 368 176S400 190.3 400 208S385.7 240 368 240zM256 416C114.6 416 0 322.9 0 208C0 160.4 19.9 116.8 52.9 81.7C38 42.3 7 8.9 6.5 8.5C-0.1 1.5 -1.9 -8.7 1.9 -17.5S14.4 -32 24 -32C85.5 -32 134 -6.3 163.1 14.3C192 5.2 223.2 0 256 0C397.4 0 512 93.1 512 208S397.4 416 256 416zM256 48C229.3 48 202.9 52.1 177.6 60.1L154.9 67.3L135.4 53.5C121.1 43.4 101.5 32.1 77.9 24.5C85.2 36.6 92.3 50.2 97.8 64.7L108.4 92.8L87.8 114.6C69.7 133.9 48 165.8 48 208C48 296.2 141.3 368 256 368S464 296.2 464 208S370.7 48 256 48z" />
<glyph glyph-name="comment"
unicode="&#xF075;"
horiz-adv-x="512" d=" M256 416C114.6 416 0 322.9 0 208C0 160.4 19.9 116.8 52.9 81.7C38 42.3 7 8.9 6.5 8.5C-0.1 1.5 -1.9 -8.7 1.9 -17.5S14.4 -32 24 -32C85.5 -32 134 -6.3 163.1 14.3C192 5.2 223.2 0 256 0C397.4 0 512 93.1 512 208S397.4 416 256 416zM256 48C229.3 48 202.9 52.1 177.6 60.1L154.9 67.3L135.4 53.5C121.1 43.4 101.5 32.1 77.9 24.5C85.2 36.6 92.3 50.2 97.8 64.7L108.4 92.8L87.8 114.6C69.7 133.9 48 165.8 48 208C48 296.2 141.3 368 256 368S464 296.2 464 208S370.7 48 256 48z" />
<glyph glyph-name="comments"
unicode="&#xF086;"
horiz-adv-x="576" d=" M532 61.8C559.5 88.9 576 122.9 576 160C576 240 499.5 306.1 399.8 317.9C368.3 375.5 294.3 416 208 416C93.1 416 0 344.4 0 256C0 219 16.5 185 44 157.8C28.7 127.1 6.7 103.3 6.3 102.9C0 96.2000000000001 -1.8 86.4 1.9 77.9C5.5 69.4 13.9 63.9 23.1 63.9C76.6 63.9 119.8 84.1 148.3 102.7000000000001C157.5 100.6 167 99.0000000000001 176.7 97.8000000000001C208.1 40.4 281.8 0 368 0C388.8 0 408.8 2.4 427.8 6.8C456.3 -11.7 499.4 -32 553 -32C562.2 -32 570.5 -26.5 574.2 -18C577.8000000000001 -9.5 576.1 0.3 569.8000000000001 7C569.4000000000001 7.3 547.3000000000001 31.1 532.0000000000001 61.8zM139.2 154.1L122.1 143C108 133.9 93.6 126.7 79 121.6C81.7 126.3 84.4 131.3 87 136.4L102.5 167.5000000000001L77.7 192C64.2 205.4 48 227.3 48 256C48 316.7 121.3 368 208 368S368 316.7 368 256S294.7 144 208 144C191.5 144 175 145.9 159 149.6L139.2 154.1zM498.3 96L473.6 71.6L489.1 40.5C491.7 35.4 494.4 30.4 497.1 25.7C482.5 30.8 468.1 38 454 47.1L436.9 58.2L417 53.6C401 49.9 384.5 47.9999999999999 368 47.9999999999999C314 47.9999999999999 265.8 68.1 236.7 97.6999999999999C338 108.5 416 175.1 416 256C416 259.4 415.6 262.7 415.3 266C479.7 251.5 528 209.2 528 160C528 131.3 511.8 109.4 498.3 96z" />
<glyph glyph-name="compass"
unicode="&#xF14E;"
horiz-adv-x="512" d=" M256 440C119.033 440 8 328.967 8 192S119.033 -56 256 -56S504 55.033 504 192S392.967 440 256 440zM256 -8C145.468 -8 56 81.451 56 192C56 302.531 145.451 392 256 392C366.532 392 456 302.549 456 192C456 81.468 366.549 -8 256 -8zM347.326 304.131L313.9670000000001 166.352A24.005 24.005 0 0 0 307.1950000000001 154.623L204.5550000000001 56.844C187.4510000000001 40.551 158.9950000000001 56.41 164.6750000000001 79.868L198.0340000000001 217.647A23.997 23.997 0 0 0 204.8060000000001 229.376L307.4480000000001 327.155C324.7330000000001 343.625 352.9420000000001 327.33 347.3260000000001 304.131zM256 224C238.327 224 224 209.673 224 192S238.327 160 256 160S288 174.327 288 192S273.673 224 256 224z" />
<glyph glyph-name="copy"
unicode="&#xF0C5;"
horiz-adv-x="448" d=" M433.941 382.059L382.059 433.941A48 48 0 0 1 348.118 448H176C149.49 448 128 426.51 128 400V352H48C21.49 352 0 330.51 0 304V-16C0 -42.51 21.49 -64 48 -64H272C298.51 -64 320 -42.51 320 -16V32H400C426.51 32 448 53.49 448 80V348.118A48 48 0 0 1 433.941 382.059zM266 -16H54A6 6 0 0 0 48 -10V298A6 6 0 0 0 54 304H128V80C128 53.49 149.49 32 176 32H272V-10A6 6 0 0 0 266 -16zM394 80H182A6 6 0 0 0 176 86V394A6 6 0 0 0 182 400H288V312C288 298.745 298.745 288 312 288H400V86A6 6 0 0 0 394 80zM400 336H336V400H345.632C347.223 400 348.749 399.368 349.875 398.243L398.243 349.875A6 6 0 0 0 400 345.632V336z" />
<glyph glyph-name="copyright"
unicode="&#xF1F9;"
horiz-adv-x="512" d=" M256 440C119.033 440 8 328.967 8 192S119.033 -56 256 -56S504 55.033 504 192S392.967 440 256 440zM256 -8C145.468 -8 56 81.451 56 192C56 302.531 145.451 392 256 392C366.532 392 456 302.549 456 192C456 81.468 366.549 -8 256 -8zM363.351 93.064C353.737 83.352 317.8210000000001 51.668 259.286 51.668C176.856 51.668 118.802 113.093 118.802 193.235C118.802 272.387 179.077 332.636 258.564 332.636C314.095 332.636 347.302 306.016 356.157 297.857A11.965 11.965 0 0 0 358.093 282.535L339.938 254.422C336.097 248.472 327.972 247.14 322.439 251.501C313.844 258.277 290.625 274.039 260.731 274.039C212.428 274.039 182.815 238.709 182.815 193.957C182.815 152.368 209.703 110.265 261.092 110.265C293.749 110.265 317.935 129.304 326.818 137.49C332.088 142.347 340.414 141.529 344.638 135.752L364.503 108.582A11.947000000000001 11.947000000000001 0 0 0 363.351 93.064z" />
<glyph glyph-name="credit-card"
unicode="&#xF09D;"
horiz-adv-x="576" d=" M527.9 416H48.1C21.5 416 0 394.5 0 368V16C0 -10.5 21.5 -32 48.1 -32H527.9C554.5 -32 576 -10.5 576 16V368C576 394.5 554.5 416 527.9 416zM54.1 368H521.9C525.1999999999999 368 527.9 365.3 527.9 362V320H48.1V362C48.1 365.3 50.8 368 54.1 368zM521.9 16H54.1C50.8 16 48.1 18.7 48.1 22V192H527.9V22C527.9 18.7 525.1999999999999 16 521.9 16zM192 116V76C192 69.4 186.6 64 180 64H108C101.4 64 96 69.4 96 76V116C96 122.6 101.4 128 108 128H180C186.6 128 192 122.6 192 116zM384 116V76C384 69.4 378.6 64 372 64H236C229.4 64 224 69.4 224 76V116C224 122.6 229.4 128 236 128H372C378.6 128 384 122.6 384 116z" />
<glyph glyph-name="dot-circle"
unicode="&#xF192;"
horiz-adv-x="512" d=" M256 392C366.532 392 456 302.549 456 192C456 81.468 366.549 -8 256 -8C145.468 -8 56 81.451 56 192C56 302.532 145.451 392 256 392M256 440C119.033 440 8 328.967 8 192S119.033 -56 256 -56S504 55.033 504 192S392.967 440 256 440zM256 272C211.817 272 176 236.183 176 192S211.817 112 256 112S336 147.817 336 192S300.183 272 256 272z" />
<glyph glyph-name="edit"
unicode="&#xF044;"
horiz-adv-x="576" d=" M402.3 103.1L434.3 135.1C439.3 140.1 448 136.6 448 129.4V-16C448 -42.5 426.5 -64 400 -64H48C21.5 -64 0 -42.5 0 -16V336C0 362.5 21.5 384 48 384H321.5C328.6 384 332.2 375.4 327.2 370.3L295.2 338.3C293.7 336.8 291.7 336 289.5 336H48V-16H400V97.5C400 99.6 400.8 101.6 402.3 103.1zM558.9 304.9000000000001L296.3 42.3L205.9 32.3C179.7 29.4 157.4 51.5 160.3 77.9L170.3 168.3000000000001L432.9 430.9C455.8 453.8 492.8 453.8 515.6 430.9L558.8000000000001 387.7C581.7 364.8 581.7 327.7 558.9000000000001 304.9zM460.1 274L402 332.1L216.2 146.2L208.9 80.9L274.2 88.2L460.1 274zM524.9 353.7L481.7 396.9C477.6 401 470.9 401 466.9 396.9L436 366L494.1 307.9L525 338.8C529 343 529 349.6 524.9 353.7000000000001z" />
<glyph glyph-name="envelope-open"
unicode="&#xF2B6;"
horiz-adv-x="512" d=" M494.586 283.4840000000001C489.889 287.367 382.863 373.4340000000001 359.3350000000001 392.141C337.231 409.809 299.437 448 256 448C212.795 448 175.364 410.283 152.665 392.141C128.202 372.6910000000001 21.595 286.9460000000001 17.515 283.592A48.004000000000005 48.004000000000005 0 0 1 0 246.515V-16C0 -42.51 21.49 -64 48 -64H464C490.51 -64 512 -42.51 512 -16V246.491A48 48 0 0 1 494.586 283.4840000000001zM464 -10A6 6 0 0 0 458 -16H54A6 6 0 0 0 48 -10V243.653C48 245.466 48.816 247.179 50.226 248.318C66.096 261.132 159.019 335.872 182.59 354.611C200.755 369.12 232.398 400 256 400C279.693 400 311.857 368.631 329.41 354.611C352.983 335.87 445.913 261.118 461.776 248.295A5.99 5.99 0 0 0 463.9999999999999 243.632V-10zM432.009 177.704C436.2580000000001 172.545 435.474 164.909 430.264 160.723C401.289 137.44 370.99 113.126 359.3350000000001 103.86C336.636 85.717 299.205 48 256 48C212.548 48 174.713 86.237 152.665 103.86C141.386 112.827 110.921 137.273 81.738 160.725C76.528 164.912 75.745 172.547 79.993 177.706L95.251 196.234C99.429 201.307 106.908 202.077 112.03 197.96C140.648 174.959 170.596 150.925 182.59 141.389C200.143 127.369 232.307 96 256 96C279.602 96 311.246 126.88 329.41 141.389C341.404 150.924 371.354 174.959 399.973 197.957C405.095 202.073 412.574 201.303 416.751 196.23L432.009 177.704z" />
<glyph glyph-name="envelope"
unicode="&#xF0E0;"
horiz-adv-x="512" d=" M464 384H48C21.49 384 0 362.51 0 336V48C0 21.49 21.49 0 48 0H464C490.51 0 512 21.49 512 48V336C512 362.51 490.51 384 464 384zM464 336V295.195C441.578 276.936 405.832 248.544 329.413 188.705C312.572 175.458 279.212 143.633 256 144.004C232.792 143.629 199.421 175.463 182.587 188.705C106.18 248.535 70.425 276.933 48 295.195V336H464zM48 48V233.602C70.914 215.351 103.409 189.74 152.938 150.956C174.795 133.751 213.072 95.77 256 96.001C298.717 95.77 336.509 133.2000000000001 359.053 150.948C408.581 189.7310000000001 441.085 215.3490000000001 464 233.6010000000001V48H48z" />
<glyph glyph-name="eye-slash"
unicode="&#xF070;"
horiz-adv-x="576" d=" M272.702 88.861C192.219 97.872 136.49 175.747 155.772 255.903L272.702 88.861zM288 56C185.444 56 95.908 110.701 48 192C69.755 228.917 100.1 260.342 136.344 283.658L108.803 323.0010000000001C67.001 295.766 31.921 259.259 6.646 216.369A47.999 47.999 0 0 1 6.646 167.63C63.004 71.994 168.14 8 288 8A332.89 332.89 0 0 1 327.648 10.367L295.627 56.111A284.16 284.16 0 0 0 288 56zM569.354 167.631C536.1220000000001 111.237 485.933 65.889 425.8000000000001 38.139L473.9160000000001 -30.601C477.717 -36.03 476.3960000000001 -43.513 470.967 -47.313L450.23 -61.83C444.8010000000001 -65.631 437.3180000000001 -64.3099999999999 433.5180000000001 -58.881L102.084 414.601C98.283 420.03 99.604 427.513 105.033 431.313L125.77 445.83C131.199 449.631 138.682 448.31 142.482 442.881L198.008 363.556C226.612 371.657 256.808 376 288 376C407.86 376 512.996 312.006 569.354 216.369A48.00200000000001 48.00200000000001 0 0 0 569.354 167.631zM528 192C483.843 266.933 404.323 319.27 311.838 327.007C302.042 316.9220000000001 296 303.17 296 288C296 257.072 321.072 232 352 232S408 257.072 408 288L407.999 288.0420000000001C438.6310000000001 230.765 424.738 157.7820000000001 371.0710000000001 116.323L397.766 78.188C452.626 101.449 498.308 141.614 528 192z" />
<glyph glyph-name="eye"
unicode="&#xF06E;"
horiz-adv-x="576" d=" M569.354 216.369C512.97 312.051 407.81 376 288 376C168.14 376 63.004 312.006 6.646 216.369A47.999 47.999 0 0 1 6.646 167.63C63.031 71.949 168.19 8 288 8C407.86 8 512.996 71.994 569.354 167.631A47.997 47.997 0 0 1 569.354 216.369zM288 56C185.444 56 95.909 110.701 48 192C92.157 266.933 171.677 319.27 264.1620000000001 327.007C273.9580000000001 316.9220000000001 280 303.17 280 288C280 257.072 254.928 232 224 232S168 257.072 168 288L168.001 288.0420000000001C157.794 268.957 152 247.156 152 224C152 148.889 212.889 88 288 88S424 148.889 424 224C424 255.031 413.6 283.629 396.105 306.515C451.704 283.362 498.009 242.894 528 192C480.092 110.701 390.5560000000001 56 288 56z" />
<glyph glyph-name="file-alt"
unicode="&#xF15C;"
horiz-adv-x="384" d=" M288 200V172C288 165.4 282.6 160 276 160H108C101.4 160 96 165.4 96 172V200C96 206.6 101.4 212 108 212H276C282.6 212 288 206.6 288 200zM276 128H108C101.4 128 96 122.6 96 116V88C96 81.4 101.4 76 108 76H276C282.6 76 288 81.4 288 88V116C288 122.6 282.6 128 276 128zM384 316.1V-16C384 -42.5 362.5 -64 336 -64H48C21.5 -64 0 -42.5 0 -16V400C0 426.5 21.5 448 48 448H252.1C264.8 448 277 442.9 286 433.9L369.9 350C378.9 341.1 384 328.8 384 316.1zM256 396.1V320H332.1L256 396.1zM336 -16V272H232C218.7 272 208 282.7 208 296V400H48V-16H336z" />
<glyph glyph-name="file-archive"
unicode="&#xF1C6;"
horiz-adv-x="384" d=" M369.941 350.059L286.059 433.9410000000001A48 48 0 0 1 252.118 448H48C21.49 448 0 426.51 0 400V-16C0 -42.51 21.49 -64 48 -64H336C362.51 -64 384 -42.51 384 -16V316.118A48 48 0 0 1 369.941 350.059zM256 396.118L332.118 320H256V396.118zM336 -16H48V400H127.714V384H159.714V400H208V296C208 282.745 218.745 272 232 272H336V-16zM192.27 352H160.27V384H192.27V352zM160.27 352V320H128.27V352H160.27zM160.27 288V256H128.27V288H160.27zM192.27 288H160.27V320H192.27V288zM194.179 182.322A12 12 0 0 1 182.406 192H160.27V224H128.27V192L108.58 94.894C101.989 62.389 126.834 32 160 32C193.052 32 217.871 62.192 211.476 94.62L194.179 182.322zM160.27 57.927C142.352 57.927 127.826 70.032 127.826 84.963C127.826 99.895 142.351 111.999 160.27 111.999S192.714 99.894 192.714 84.963C192.714 70.032 178.188 57.927 160.27 57.927zM192.27 224H160.27V256H192.27V224z" />
<glyph glyph-name="file-audio"
unicode="&#xF1C7;"
horiz-adv-x="384" d=" M369.941 350.059L286.059 433.9410000000001A48 48 0 0 1 252.118 448H48C21.49 448 0 426.51 0 400V-16C0 -42.51 21.49 -64 48 -64H336C362.51 -64 384 -42.51 384 -16V316.118A48 48 0 0 1 369.941 350.059zM332.118 320H256V396.118L332.118 320zM48 -16V400H208V296C208 282.745 218.745 272 232 272H336V-16H48zM192 60.024C192 49.333 179.074 43.979 171.515 51.539L136 87.514H108C101.373 87.514 96 92.887 96 99.514V155.514C96 162.141 101.373 167.514 108 167.514H136L171.515 204.461C179.075 212.021 192 206.667 192 195.976V60.024zM233.201 107.154C242.252 116.451 242.261 131.287 233.202 140.593C211.053 163.345 245.437 196.839 267.597 174.074C294.795 146.134 294.809 101.63 267.598 73.673C245.805 51.287 210.651 83.988 233.201 107.154z" />
<glyph glyph-name="file-code"
unicode="&#xF1C9;"
horiz-adv-x="384" d=" M369.941 350.059L286.059 433.9410000000001A48 48 0 0 1 252.118 448H48C21.49 448 0 426.51 0 400V-16C0 -42.51 21.49 -64 48 -64H336C362.51 -64 384 -42.51 384 -16V316.118A48 48 0 0 1 369.941 350.059zM332.118 320H256V396.118L332.118 320zM48 -16V400H208V296C208 282.745 218.745 272 232 272H336V-16H48zM149.677 99.115L116.854 128L149.676 156.885A8.793 8.793 0 0 1 150.281 169.509L132.878 188.073C129.494 191.686 123.914 191.735 120.44 188.4740000000001L62.78 134.42C59.077 130.946 59.076 125.053 62.781 121.5800000000001L120.44 67.525A8.738 8.738 0 0 1 126.452 65.1440000000001A8.746 8.746 0 0 1 132.879 67.9260000000001L150.282 86.489A8.795 8.795 0 0 1 149.677 99.115zM233.961 226.965L209.56 234.049A8.796 8.796 0 0 1 198.655 228.051L144.04 39.939C142.687 35.279 145.378 30.387 150.038 29.0340000000001L174.441 21.95C179.121 20.595 183.998 23.304 185.346 27.948L239.958 216.06C241.312 220.72 238.621 225.612 233.961 226.9650000000001zM321.219 134.42L263.561 188.475C260.035 191.7820000000001 254.462 191.6400000000001 251.122 188.074L233.719 169.511A8.795 8.795 0 0 1 234.324 156.886L267.146 128L234.324 99.115A8.793 8.793 0 0 1 233.719 86.491L251.122 67.927A8.797 8.797 0 0 1 263.5610000000001 67.526H263.5600000000001L321.2200000000001 121.581C324.923 125.054 324.923 130.947 321.2190000000001 134.42z" />
<glyph glyph-name="file-excel"
unicode="&#xF1C3;"
horiz-adv-x="384" d=" M369.9 350.1L286 434C277 443 264.8 448.1 252.1 448.1H48C21.5 448 0 426.5 0 400V-16C0 -42.5 21.5 -64 48 -64H336C362.5 -64 384 -42.5 384 -16V316.1C384 328.8 378.9 341.1 369.9 350.1zM332.1 320H256V396.1L332.1 320zM48 -16V400H208V296C208 282.7 218.7 272 232 272H336V-16H48zM260 224H231.2C226.8 224 222.8 221.6 220.7 217.7C202.7 184.6 198.5 175.3 192.1 160C178.2 189.1 185.2 177.3 163.5 217.7C161.4 221.6 157.3 224 152.9 224H124C114.7 224 109 214 113.6 206L159.9 128L113.6 50C108.9 42 114.7 32 124 32H152.9C157.3 32 161.3 34.4 163.4 38.3C185.1 78.3 186.4 83.3 192 96C206.9 65.8 197.9 80.1 220.6 38.3C222.7 34.4 226.8 32 231.2 32H260C269.3 32 275 42 270.4 50L224 128C224.7 129.1 254.3 178.5 270.3 206C275 214 269.2 224 260 224z" />
<glyph glyph-name="file-image"
unicode="&#xF1C5;"
horiz-adv-x="384" d=" M369.9 350.1L286 434C277 443 264.8 448.1 252.1 448.1H48C21.5 448 0 426.5 0 400V-16C0 -42.5 21.5 -64 48 -64H336C362.5 -64 384 -42.5 384 -16V316.1C384 328.8 378.9 341.1 369.9 350.1zM332.1 320H256V396.1L332.1 320zM48 -16V400H208V296C208 282.7 218.7 272 232 272H336V-16H48zM80 32H304V160L280.5 183.5C275.8 188.2 268.2 188.2 263.5 183.5L176 96L136.5 135.5C131.8 140.2 124.2 140.2 119.5 135.5L80 96V32zM128 272C101.5 272 80 250.5 80 224S101.5 176 128 176S176 197.5 176 224S154.5 272 128 272z" />
<glyph glyph-name="file-pdf"
unicode="&#xF1C1;"
horiz-adv-x="384" d=" M369.9 350.1L286 434C277 443 264.8 448.1 252.1 448.1H48C21.5 448 0 426.5 0 400V-16C0 -42.5 21.5 -64 48 -64H336C362.5 -64 384 -42.5 384 -16V316.1C384 328.8 378.9 341.1 369.9 350.1zM332.1 320H256V396.1L332.1 320zM48 -16V400H208V296C208 282.7 218.7 272 232 272H336V-16H48zM298.2 127.7C286 139.7 251.2 136.4 233.8 134.2C216.6 144.7 205.1 159.2 197 180.5C200.9 196.6 207.1 221.1 202.4 236.5C198.2 262.7 164.6 260.1 159.8 242.4C155.4 226.3 159.4 203.9 166.8 175.3C156.8 151.4 141.9 119.3 131.4 100.9C111.4 90.6 84.4 74.7 80.4 54.7C77.1 38.9 106.4 -0.5 156.5 85.9C178.9 93.3 203.3 102.4 224.9 106C243.8 95.8 265.9 89 280.7 89C306.2 89 308.7 117.2 298.2 127.7zM100.1 49.9C105.2 63.6 124.6 79.4 130.5 84.9C111.5 54.6 100.1 49.2 100.1 49.9zM181.7 240.5C189.1 240.5 188.4 208.4 183.5 199.7C179.1 213.6 179.2 240.5 181.7 240.5zM157.3 103.9C167 120.8 175.3 140.9 182 158.6C190.3 143.5 200.9 131.4 212.1 123.1C191.3 118.8 173.2 109.9999999999999 157.3 103.9zM288.9 108.9S283.9 102.9 251.6 116.7C286.7 119.3 292.5 111.3 288.9 108.9z" />
<glyph glyph-name="file-powerpoint"
unicode="&#xF1C4;"
horiz-adv-x="384" d=" M369.9 350.1L286 434C277 443 264.8 448.1 252.1 448.1H48C21.5 448 0 426.5 0 400V-16C0 -42.5 21.5 -64 48 -64H336C362.5 -64 384 -42.5 384 -16V316.1C384 328.8 378.9 341.1 369.9 350.1zM332.1 320H256V396.1L332.1 320zM48 -16V400H208V296C208 282.7 218.7 272 232 272H336V-16H48zM120 44V212C120 218.6 125.4 224 132 224H201.2C237.9 224 264 197 264 157.7C264 83.4 195.3 91.2 168.5 91.2V44C168.5 37.4 163.1 32 156.5 32H132C125.4 32 120 37.4 120 44zM168.5 131.4H191.5C199.4 131.4 205.4 133.8 209.6 138.6C218.1 148.4 218 167.1 209.7 176.4C205.6 181 199.8 183.4 192.3 183.4H168.4V131.4z" />
<glyph glyph-name="file-video"
unicode="&#xF1C8;"
horiz-adv-x="384" d=" M369.941 350.059L286.059 433.9410000000001A48 48 0 0 1 252.118 448H48C21.49 448 0 426.51 0 400V-16C0 -42.51 21.49 -64 48 -64H336C362.51 -64 384 -42.51 384 -16V316.118A48 48 0 0 1 369.941 350.059zM332.118 320H256V396.118L332.118 320zM48 -16V400H208V296C208 282.745 218.745 272 232 272H336V-16H48zM276.687 195.303L224 142.626V180C224 191.046 215.046 200 204 200H100C88.954 200 80 191.046 80 180V76C80 64.954 88.954 56 100 56H204C215.046 56 224 64.954 224 76V113.374L276.687 60.7000000000001C286.704 50.682 304 57.72 304 72.014V183.989C304 198.3 286.691 205.308 276.687 195.303z" />
<glyph glyph-name="file-word"
unicode="&#xF1C2;"
horiz-adv-x="384" d=" M369.9 350.1L286 434C277 443 264.8 448.1 252.1 448.1H48C21.5 448 0 426.5 0 400V-16C0 -42.5 21.5 -64 48 -64H336C362.5 -64 384 -42.5 384 -16V316.1C384 328.8 378.9 341.1 369.9 350.1zM332.1 320H256V396.1L332.1 320zM48 -16V400H208V296C208 282.7 218.7 272 232 272H336V-16H48zM268.1 192C262.4000000000001 192 257.5 188 256.4000000000001 182.5C235.8000000000001 84.8 236.0000000000001 87.1 235.4000000000001 79C235.2000000000001 80.2 235.0000000000001 81.6 234.7000000000001 83.3C233.9000000000001 88.4 235.0000000000001 83.1 211.1000000000001 182.8C209.8000000000001 188.2 205.0000000000001 192 199.4000000000001 192H186.1000000000001C180.6000000000001 192 175.8000000000001 188.2 174.4000000000001 182.9C150.0000000000001 83.9 150.4000000000001 86.7 149.6000000000001 79.2C149.5000000000001 80.3 149.4000000000001 81.7 149.1000000000001 83.4C148.4000000000001 88.6 135.0000000000001 156.7 130.0000000000001 182.4C128.9000000000001 188 124.0000000000001 192.1 118.2000000000001 192.1H101.4000000000001C93.6000000000001 192.1 87.9000000000001 184.8 89.7000000000001 177.3C97.7000000000001 144.6999999999999 116.4000000000001 67.8 122.9000000000001 41.3C124.2000000000001 35.9 129.0000000000001 32.1999999999999 134.6000000000001 32.1999999999999H159.8000000000001C165.3000000000001 32.1999999999999 170.1000000000001 35.8999999999999 171.4 41.3L189.3000000000001 112.6999999999999C190.8000000000001 118.8999999999999 191.8000000000001 124.6999999999999 192.3000000000001 130L195.2000000000001 112.6999999999999C195.3000000000001 112.3 207.8000000000001 62.1999999999999 213.1000000000001 41.3C214.4000000000001 35.9999999999999 219.2000000000001 32.1999999999999 224.7000000000001 32.1999999999999H249.4000000000001C254.9000000000001 32.1999999999999 259.7000000000001 35.8999999999999 261.0000000000001 41.3C281.8000000000001 123.1999999999999 291.2000000000001 160.3 295.5000000000001 177.3C297.4000000000001 184.9 291.7000000000001 192.2 283.9000000000001 192.2H268.1z" />
<glyph glyph-name="file"
unicode="&#xF15B;"
horiz-adv-x="384" d=" M369.9 350.1L286 434C277 443 264.8 448.1 252.1 448.1H48C21.5 448 0 426.5 0 400V-16C0 -42.5 21.5 -64 48 -64H336C362.5 -64 384 -42.5 384 -16V316.1C384 328.8 378.9 341.1 369.9 350.1zM332.1 320H256V396.1L332.1 320zM48 -16V400H208V296C208 282.7 218.7 272 232 272H336V-16H48z" />
<glyph glyph-name="flag"
unicode="&#xF024;"
horiz-adv-x="512" d=" M336.174 368C287.042 368 242.869 400 174.261 400C142.96 400 115.958 393.5180000000001 93.54 384.832A48.04 48.04 0 0 1 95.682 405.559C93.067 428.425 74.167 446.406 51.201 447.896C23.242 449.71 0 427.569 0 400C0 382.236 9.657 366.738 24 358.438V-48C24 -56.837 31.163 -64 40 -64H56C64.837 -64 72 -56.837 72 -48V35.443C109.869 52.72 143.259 64 199.826 64C248.958 64 293.131 32 361.7390000000001 32C420.218 32 463.711 54.617 490.287 71.981C503.846 80.839 512 95.949 512 112.145V352.063C512 386.522 476.736 409.831 445.096 396.18C409.193 380.6910000000001 371.641 368 336.174 368zM464 112C442.217 96.588 403.176 80 361.7390000000001 80C301.7940000000001 80 259.737 112 199.826 112C156.465 112 103.447 102.597 72 88V320C93.784 335.4120000000001 132.824 352 174.261 352C234.206 352 276.2630000000001 320 336.1740000000001 320C379.4450000000001 320 432.4940000000001 337.366 464 352V112z" />
<glyph glyph-name="folder-open"
unicode="&#xF07C;"
horiz-adv-x="576" d=" M527.943 224H480V272C480 298.51 458.51 320 432 320H272L208 384H48C21.49 384 0 362.51 0 336V48C0 21.49 21.49 0 48 0H448A48.001 48.001 0 0 1 488.704 22.56L568.646 150.56C588.5939999999999 182.477 565.608 224 527.943 224zM54 336H188.118L252.118 272H426A6 6 0 0 0 432 266V224H152A48 48 0 0 1 110.902 200.798L48 96.551V330.007A5.993 5.993 0 0 0 54 336zM448 48H72L149.234 176H528L448 48z" />
<glyph glyph-name="folder"
unicode="&#xF07B;"
horiz-adv-x="512" d=" M464 320H272L208 384H48C21.49 384 0 362.51 0 336V48C0 21.49 21.49 0 48 0H464C490.51 0 512 21.49 512 48V272C512 298.51 490.51 320 464 320zM458 48H54C50.686 48 48 50.678 48 53.992V330.008A5.993 5.993 0 0 0 54 336H188.118L252.118 272H458A6 6 0 0 0 464 266V54A6 6 0 0 0 458 48z" />
<glyph glyph-name="frown"
unicode="&#xF119;"
horiz-adv-x="496" d=" M248 440C111 440 0 329 0 192S111 -56 248 -56S496 55 496 192S385 440 248 440zM248 -8C137.7 -8 48 81.7 48 192S137.7 392 248 392S448 302.3 448 192S358.3 -8 248 -8zM168 208C185.7 208 200 222.3 200 240S185.7 272 168 272S136 257.7 136 240S150.3 208 168 208zM328 272C310.3 272 296 257.7 296 240S310.3 208 328 208S360 222.3 360 240S345.7 272 328 272zM248 144C207.8 144 170 126.3 144.2 95.4C135.7 85.2 137.1 70.1 147.3 61.6C157.5 53.1 172.6 54.4999999999999 181.1 64.7C197.7 84.6 222.1 96.1 248 96.1S298.3 84.7 314.9 64.7C319.7 59 326.5 56.1 333.4 56.1C338.8 56.1 344.3 57.9 348.8 61.7C359 70.2 360.3 85.3 351.9 95.5C326 126.3 288.2 144 248 144z" />
<glyph glyph-name="futbol"
unicode="&#xF1E3;"
horiz-adv-x="496" d=" M483.8 268.6C449.8 373.4 352.6 440 248.1 440C222.7 440 196.9 436.1 171.4 427.8C41.2 385.5 -30.1 245.6 12.2 115.4C46.2 10.6 143.4 -56 247.9 -56C273.3 -56 299.1 -52.1 324.6 -43.8C454.8 -1.5 526.1 138.4 483.8 268.6zM409.3 74.9L357.1 68.5L313.4000000000001 129.4L337.8 204.6L408.9 226.7L447.8 190.3C447.6 159.6 440.4 129.1999999999999 426.1 101.1C421.4 91.8 415.4 83.3 409.3 74.9zM409.3 310.3L398.9000000000001 257.2L328.2000000000001 235.2L264.0000000000001 281.7V355.5L311.4000000000001 381.7C350.6 368.7 384.8000000000001 343.7 409.3000000000001 310.3zM184.9 381.6L232 355.5V281.7L167.8 235.2L97.2 257.2L87.1 309.7C111.4 343.1 145 368.3 184.9 381.6zM139 68.5L85.9 75C71.5 95.1 48.6 134.6 48.1 190.3L87.1 226.7L158.2 204.5L182.5 130.2000000000001L139 68.5000000000001zM187.2 1.5L164.8 49.6L208.4 111.3H287L331.3 49.6L308.9000000000001 1.5C302.7000000000001 -0.3 251.3000000000001 -18.9 187.2000000000001 1.5z" />
<glyph glyph-name="gem"
unicode="&#xF3A5;"
horiz-adv-x="576" d=" M464 448H112C108 448 104.2 446 102 442.6L2 295.4C-0.9 291 -0.6 285.2000000000001 2.7 281.2000000000001L278.7 -59.6C283.5 -65.5 292.5 -65.5 297.3 -59.6L573.3 281.2C576.5999999999999 285.3 576.9 291 574 295.4L474.1 442.6C471.8 446 468.1 448 464 448zM444.7 400L508 304H439.6L387.9000000000001 400H444.7000000000001zM242.6 400H333.3L385 304H191L242.6 400zM131.3 400H188.1L136.4 304H68L131.3 400zM88.3 256H139.7L208 96L88.3 256zM191.2 256H384.8L288 12.7L191.2 256zM368 96L436.2 256H487.6L368 96z" />
<glyph glyph-name="hand-lizard"
unicode="&#xF258;"
horiz-adv-x="576" d=" M556.686 157.458L410.328 383.171C397.001 403.728 374.417 416 349.917 416H56C25.121 416 0 390.878 0 360V352C0 307.8880000000001 35.888 272 80 272H276.0420000000001L257.7090000000001 224H144C95.477 224 56 184.523 56 136C56 105.121 81.121 80 112 80H243.552C246.539 80 249.466 79.451 252.249 78.369L352 39.582V-32H576V92.171C576 115.396 569.321 137.972 556.686 157.458zM528 16H400V39.582C400 59.53 387.986 77.09 369.396 84.318L269.645 123.106A71.733 71.733 0 0 1 243.552 128H112C107.589 128 104 131.589 104 136C104 158.056 121.944 176 144 176H257.709C277.476 176 295.495 188.407 302.549 206.873L327.101 271.154C336.097 294.707 318.673 320 293.471 320H80C62.355 320 48 334.355 48 352V360C48 364.411 51.589 368 56 368H349.917C358.083 368 365.61 363.91 370.054 357.058L516.412 131.343A71.84 71.84 0 0 0 528 92.171V16z" />
<glyph glyph-name="hand-paper"
unicode="&#xF256;"
horiz-adv-x="448" d=" M372.57 335.359V346.184C372.57 389.796 332.05 422.875 289.531 411.73C263.902 461.23 195.441 459.18 171.549 410.983C130.269 421.544 89.144 390.055 89.144 346V219.87C69.191 227.297 45.836 224.938 27.061 210.999C-2.294 189.203 -8.733 147.666 12.511 117.846L132.48 -50.569A32 32 0 0 1 158.542 -64.001H381.439C396.343 -64.001 409.274 -53.712 412.621 -39.188L442.805 91.77A203.637 203.637 0 0 1 448 137.436V269C448 309.62 412.477 340.992 372.57 335.359zM399.997 137.437C399.997 125.706 398.663 113.968 396.0320000000001 102.551L368.707 -16H166.787L51.591 145.697C37.152 165.967 66.614 188.473 80.985 168.302L108.113 130.223C117.108 117.597 137.144 123.936 137.144 139.506V346C137.144 371.645 173.715 370.81 173.715 345.309V192C173.715 183.163 180.878 176 189.715 176H196.571C205.408 176 212.571 183.163 212.571 192V381C212.571 406.663 249.142 405.81 249.142 380.309V192C249.142 183.163 256.305 176 265.142 176H271.998C280.835 176 287.998 183.163 287.998 192V346.875C287.998 372.5470000000001 324.568 371.685 324.568 346.184V192C324.568 183.163 331.731 176 340.568 176H347.425C356.262 176 363.425 183.163 363.425 192V268.309C363.425 294.551 399.995 293.949 399.995 269V137.437z" />
<glyph glyph-name="hand-peace"
unicode="&#xF25B;"
horiz-adv-x="448" d=" M362.146 256.024C348.4360000000001 277.673 323.385 290.04 297.14 286.365V374C297.14 414.804 264.329 448 223.999 448C183.669 448 150.859 414.804 150.859 374L160 280L141.321 358.85C126.578 397.157 83.85 415.89 46.209 400.7920000000001C8.735 385.762 -9.571 343.0370000000001 5.008 305.15L60.765 160.223C30.208 135.267 16.771 102.414 36.032 68.005L90.885 -29.994C102.625 -50.97 124.73 -64 148.575 -64H354.277C385.021 -64 411.835 -42.56 418.832 -12.203L446.259 106.7960000000001A67.801 67.801 0 0 1 447.988 121.999L448 192C448 236.956 404.737 269.343 362.146 256.024zM399.987 122C399.987 120.512 399.8180000000001 119.023 399.485 117.577L372.058 -1.424C370.08 -10.006 362.768 -16 354.276 -16H148.575C142.089 -16 136.033 -12.379 132.77 -6.551L77.916 91.449C73.359 99.59 75.297 110.117 82.424 115.937L109.071 137.701A16 16 0 0 1 113.883 155.84L49.793 322.389C37.226 355.044 84.37 373.163 96.51 341.611L156.294 186.254A16 16 0 0 1 171.227 176H182.859C191.696 176 198.859 183.163 198.859 192V374C198.859 408.375 249.14 408.43 249.14 374V192C249.14 183.163 256.303 176 265.14 176H271.996C280.833 176 287.996 183.163 287.996 192V220C287.996 245.122 324.563 245.159 324.563 220V192C324.563 183.163 331.726 176 340.563 176H347.419C356.256 176 363.419 183.163 363.419 192C363.419 217.12 399.986 217.16 399.986 192V122z" />
<glyph glyph-name="hand-point-down"
unicode="&#xF0A7;"
horiz-adv-x="448" d=" M188.8 -64C234.416 -64 272 -26.235 272 19.2V54.847A93.148 93.148 0 0 1 294.064 62.776C316.0700000000001 60.269 339.0420000000001 66.2789999999999 356.855 78.761C409.342 79.9 448 116.159 448 178.701V200C448 260.063 408 298.512 408 327.2V329.879C412.952 335.626 416 343.415 416 351.999V416C416 433.673 403.106 448 387.2 448H156.8C140.894 448 128 433.673 128 416V352C128 343.416 131.048 335.627 136 329.88V327.201C136 320.237 129.807 312.339 112.332 297.0180000000001L112.184 296.889L112.038 296.7580000000001C102.101 287.9020000000001 91.197 278.642 78.785 270.9070000000001C48.537 252.202 0 240.514 0 195.2C0 138.272 35.286 103.2 83.2 103.2C91.226 103.2 98.689 104.014 105.6 105.376V19.2C105.6 -25.899 143.701 -64 188.8 -64zM188.8 -16C170.1 -16 153.6 0.775 153.6 19.2V177.6C136.275 177.6 118.4 151.2000000000001 83.2 151.2000000000001C56.8 151.2000000000001 48 171.8250000000001 48 195.2000000000001C48 203.9940000000001 80.712 215.6450000000001 104.1 230.1260000000001C118.675 239.2000000000001 131.325 249.6500000000001 143.975 260.9250000000001C162.349 277.0340000000001 180.608 294.761 183.571 320.0000000000001H360.3230000000001C364.087 277.2100000000001 400 245.491 400 200V178.701C400 138.177 377.803 121.577 338.675 128.1C330.6740000000001 113.488 304.6960000000001 103.949 285.05 115.175C266.825 95.81 238.669 97.388 224 110.225V19.2C224 0.225 207.775 -16 188.8 -16zM328 384C328 397.255 338.745 408 352 408S376 397.255 376 384S365.255 360 352 360S328 370.745 328 384z" />
<glyph glyph-name="hand-point-left"
unicode="&#xF0A5;"
horiz-adv-x="512" d=" M0 227.2C0 181.584 37.765 144 83.2 144H118.847A93.148 93.148 0 0 1 126.776 121.936C124.269 99.93 130.279 76.958 142.761 59.145C143.9 6.658 180.159 -32 242.701 -32H264C324.063 -32 362.512 8 391.2 8H393.879C399.626 3.048 407.415 0 415.999 0H479.999C497.672 0 511.999 12.894 511.999 28.8V259.2C511.999 275.106 497.672 288 479.999 288H415.999C407.415 288 399.626 284.952 393.879 280H391.2C384.236 280 376.338 286.193 361.017 303.668L360.888 303.8160000000001L360.757 303.962C351.901 313.899 342.641 324.803 334.906 337.215C316.202 367.463 304.514 416 259.2 416C202.272 416 167.2 380.714 167.2 332.8C167.2 324.774 168.014 317.3110000000001 169.376 310.4H83.2C38.101 310.4 0 272.299 0 227.2zM48 227.2C48 245.9 64.775 262.4 83.2 262.4H241.6C241.6 279.725 215.2 297.6 215.2 332.8C215.2 359.2 235.825 368 259.2000000000001 368C267.9940000000001 368 279.6450000000001 335.288 294.1260000000001 311.9C303.2000000000001 297.325 313.6500000000001 284.675 324.925 272.025C341.034 253.651 358.761 235.392 384 232.429V55.677C341.21 51.913 309.491 16 264 16H242.701C202.177 16 185.577 38.197 192.1 77.325C177.488 85.326 167.949 111.304 179.175 130.95C159.81 149.175 161.388 177.331 174.225 192H83.2C64.225 192 48 208.225 48 227.2zM448 88C461.255 88 472 77.255 472 64S461.255 40 448 40S424 50.745 424 64S434.745 88 448 88z" />
<glyph glyph-name="hand-point-right"
unicode="&#xF0A4;"
horiz-adv-x="512" d=" M428.8 310.4H342.623A115.52 115.52 0 0 1 344.799 332.8C344.799 380.714 309.727 416 252.799 416C207.485 416 195.797 367.463 177.092 337.216C169.357 324.803 160.098 313.899 151.241 303.963L151.11 303.817L150.981 303.6690000000001C135.662 286.193 127.764 280 120.8 280H118.121C112.374 284.952 104.585 288 96.001 288H32C14.327 288 0 275.106 0 259.2V28.8C0 12.894 14.327 0 32 0H96C104.584 0 112.373 3.048 118.12 8H120.799C149.487 8 187.936 -32 247.999 -32H269.298C331.8400000000001 -32 368.098 6.658 369.238 59.145C381.7200000000001 76.958 387.729 99.93 385.223 121.936A93.148 93.148 0 0 1 393.152 144H428.8C474.235 144 512 181.584 512 227.2C512 272.299 473.899 310.4 428.8 310.4zM428.8 192H337.774C350.611 177.331 352.189 149.175 332.824 130.95C344.051 111.304 334.511 85.326 319.899 77.325C326.423 38.197 309.823 16 269.299 16H248C202.509 16 170.79 51.913 128 55.676V232.429C153.239 235.393 170.966 253.651 187.075 272.025C198.35 284.675 208.8 297.3250000000001 217.874 311.9C232.355 335.288 244.006 368 252.8 368C276.175 368 296.8 359.2 296.8 332.8C296.8 297.6 270.4000000000001 279.725 270.4000000000001 262.4H428.8000000000001C447.2250000000001 262.4 464.0000000000001 245.9 464.0000000000001 227.2C464.0000000000001 208.225 447.7750000000001 192 428.8000000000001 192zM88 64C88 50.745 77.255 40 64 40S40 50.745 40 64S50.745 88 64 88S88 77.255 88 64z" />
<glyph glyph-name="hand-point-up"
unicode="&#xF0A6;"
horiz-adv-x="448" d=" M105.6 364.8V278.623A115.52 115.52 0 0 1 83.2 280.799C35.286 280.799 0 245.727 0 188.799C0 143.485 48.537 131.797 78.784 113.092C91.197 105.357 102.101 96.098 112.037 87.241L112.183 87.11L112.331 86.981C129.807 71.662 136 63.764 136 56.8V54.121C131.048 48.374 128 40.585 128 32.001V-31.999C128 -49.672 140.894 -63.999 156.8 -63.999H387.2000000000001C403.1060000000001 -63.999 416.0000000000001 -49.672 416.0000000000001 -31.999V32.001C416.0000000000001 40.585 412.9520000000001 48.374 408.0000000000001 54.121V56.8C408.0000000000001 85.488 448.0000000000001 123.937 448.0000000000001 184V205.299C448.0000000000001 267.841 409.3420000000001 304.099 356.8550000000001 305.2390000000001C339.0420000000001 317.721 316.0700000000001 323.73 294.0640000000001 321.224A93.148 93.148 0 0 1 272 329.153V364.8C272 410.235 234.416 448 188.8 448C143.701 448 105.6 409.899 105.6 364.8zM224 364.8V273.774C238.669 286.611 266.825 288.189 285.05 268.824C304.6960000000001 280.0510000000001 330.6740000000001 270.511 338.675 255.899C377.803 262.423 400 245.823 400 205.299V184C400 138.509 364.087 106.79 360.324 64H183.571C180.607 89.239 162.349 106.966 143.975 123.075C131.325 134.35 118.675 144.8 104.1 153.874C80.712 168.355 48 180.006 48 188.8C48 212.175 56.8 232.8 83.2 232.8C118.4 232.8 136.275 206.4 153.6 206.4V364.8C153.6 383.225 170.1 400 188.8 400C207.775 400 224 383.775 224 364.8zM352 24C365.255 24 376 13.255 376 0S365.255 -24 352 -24S328 -13.255 328 0S338.745 24 352 24z" />
<glyph glyph-name="hand-pointer"
unicode="&#xF25A;"
horiz-adv-x="448" d=" M358.182 268.639C338.689 293.4070000000001 305.5030000000001 300.584 278.31 287.737C263.183 303.4240000000001 242.128 310.2240000000001 221.715 307.366V381C221.715 417.944 191.979 448 155.429 448S89.143 417.944 89.143 381V219.871C69.234 227.281 45.871 224.965 27.06 210.999C-2.295 189.204 -8.733 147.6660000000001 12.51 117.847L122.209 -36.154C134.632 -53.59 154.741 -64 176 -64H354.286C385.088 -64 411.86 -42.5 418.843 -12.203L446.272 106.7960000000001A67.873 67.873 0 0 1 448 122V206C448 252.844 401.375 285.273 358.182 268.639zM80.985 168.303L108.111 130.224C117.106 117.598 137.142 123.937 137.142 139.507V381C137.142 406.12 173.713 406.16 173.713 381V206C173.713 197.164 180.876 190 189.713 190H196.57C205.407 190 212.57 197.164 212.57 206V241C212.57 266.12 249.141 266.16 249.141 241V206C249.141 197.164 256.304 190 265.141 190H272C280.837 190 288 197.164 288 206V227C288 252.12 324.5710000000001 252.16 324.5710000000001 227V206C324.5710000000001 197.164 331.7340000000001 190 340.5710000000001 190H347.4280000000001C356.2650000000001 190 363.4280000000001 197.164 363.4280000000001 206C363.4280000000001 231.121 399.999 231.16 399.999 206V122C399.999 120.512 399.8300000000001 119.023 399.497 117.577L372.067 -1.424C370.089 -10.006 362.777 -16 354.2850000000001 -16H176C170.231 -16 164.737 -13.122 161.303 -8.303L51.591 145.697C37.185 165.92 66.585 188.515 80.985 168.303zM176.143 48V144C176.143 152.837 182.411 160 190.143 160H196.143C203.875 160 210.143 152.837 210.143 144V48C210.143 39.163 203.875 32 196.143 32H190.143C182.41 32 176.143 39.163 176.143 48zM251.571 48V144C251.571 152.837 257.839 160 265.5710000000001 160H271.5710000000001C279.3030000000001 160 285.5710000000001 152.837 285.5710000000001 144V48C285.5710000000001 39.163 279.3030000000001 32 271.5710000000001 32H265.5710000000001C257.839 32 251.5710000000001 39.163 251.5710000000001 48zM327 48V144C327 152.837 333.268 160 341 160H347C354.7320000000001 160 361 152.837 361 144V48C361 39.163 354.7320000000001 32 347 32H341C333.268 32 327 39.163 327 48z" />
<glyph glyph-name="hand-rock"
unicode="&#xF255;"
horiz-adv-x="512" d=" M408.864 368.948C386.463 402.846 342.756 411.221 310.051 392.536C280.577 424.005 230.906 423.629 201.717 392.558C154.557 419.578 93.007 387.503 91.046 331.752C44.846 342.593 0 307.999 0 260.5710000000001V203.618C0 170.877 14.28 139.664 39.18 117.984L136.89 32.903C141.142 29.201 140 27.33 140 -1e-13C140 -17.6730000000001 154.327 -32.0000000000001 172 -32.0000000000001H424C441.673 -32.0000000000001 456 -17.6730000000001 456 -1e-13C456 23.5129999999999 454.985 30.745 459.982 42.37L502.817 142.026C508.911 156.203 512 171.198 512 186.5939999999999V301.0370000000001C512 353.876 457.686 389.699 408.8640000000001 368.948zM464 186.594A64.505 64.505 0 0 0 458.718 160.981L415.8830000000001 61.326C410.653 49.155 408.0000000000001 36.286 408.0000000000001 23.076V16H188V26.286C188 42.656 180.86 58.263 168.41 69.103L70.7 154.183C56.274 166.745 48 184.764 48 203.619V260.572C48 293.78 100 294.1090000000001 100 259.895V218.667A16 16 0 0 1 105.493 206.6L112.493 200.505A16 16 0 0 1 139 212.571V329.1430000000001C139 362.24 191 362.868 191 328.466V301.7150000000001C191 292.879 198.164 285.7150000000001 207 285.7150000000001H214C222.836 285.7150000000001 230 292.879 230 301.7150000000001V342.858C230 375.992 282 376.533 282 342.181V301.7150000000001C282 292.879 289.163 285.7150000000001 298 285.7150000000001H305C313.837 285.7150000000001 321 292.879 321 301.7150000000001V329.144C321 362.174 373 362.924 373 328.467V301.716C373 292.88 380.163 285.716 389 285.716H396C404.837 285.716 412 292.88 412 301.716C412 334.862 464 335.329 464 301.039V186.5940000000001z" />
<glyph glyph-name="hand-scissors"
unicode="&#xF257;"
horiz-adv-x="512" d=" M256 -32L326 -31.987C331.114 -31.987 336.231 -31.404 341.203 -30.258L460.202 -2.831C490.56 4.165 512 30.98 512 61.723V267.425C512 291.27 498.97 313.376 477.995 325.115L379.996 379.968C345.587 399.2290000000001 312.733 385.7920000000001 287.778 355.235L142.85 410.992C104.963 425.5710000000001 62.238 407.265 47.208 369.791C32.11 332.149 50.843 289.421 89.15 274.679L168 256L74 265.141C33.196 265.141 0 232.33 0 192.001C0 151.671 33.196 118.86 74 118.86H161.635C157.96 92.615 170.327 67.563 191.976 53.8539999999999C178.657 11.263 211.044 -32 256 -32zM256 16.013C230.84 16.013 230.88 52.58 256 52.58C264.837 52.58 272 59.743 272 68.58V75.436C272 84.273 264.837 91.436 256 91.436H228C202.841 91.436 202.878 128.003 228 128.003H256C264.837 128.003 272 135.166 272 144.003V150.859C272 159.696 264.837 166.859 256 166.859H74C39.57 166.859 39.625 217.14 74 217.14H256C264.837 217.14 272 224.303 272 233.14V244.772A16 16 0 0 1 261.746 259.705L106.389 319.49C74.837 331.63 92.957 378.773 125.611 366.207L292.16 302.116A16.001 16.001 0 0 1 310.299 306.928L332.063 333.5750000000001C337.883 340.702 348.411 342.639 356.551 338.0830000000001L454.551 283.2290000000001C460.379 279.966 464 273.911 464 267.424V61.723C464 53.232 458.006 45.919 449.424 43.941L330.423 16.514A19.743 19.743 0 0 0 326 16.012H256z" />
<glyph glyph-name="hand-spock"
unicode="&#xF259;"
horiz-adv-x="512" d=" M21.096 66.21L150.188 -55.303A32 32 0 0 1 172.12 -64.001H409.7200000000001C423.8900000000001 -64.001 436.3730000000001 -54.682 440.4000000000001 -41.097L472.215 66.216A115.955 115.955 0 0 1 477 99.189V136.028C477 140.079 477.476 144.132 478.414 148.073L510.144 281.4830000000001C520.243 323.8950000000001 487.828 364.221 444.6 364.0080000000001C440.456 388.8640000000001 422.057 411.1730000000001 394.75 418.0000000000001C358.947 426.9520000000001 322.523 405.3450000000001 313.5 369.25L296.599 264L274.924 395.99C266.638 432.06 230.621 454.562 194.62 446.286C165.004 439.4820000000001 144.482 413.897 142.738 384.991C100.101 384.16 69.283 344.428 78.667 303.147L109.707 166.639C82.513 189.154 42.423 186.631 18.225 160.917C-7.151 133.956 -5.873 91.592 21.096 66.21zM53.164 128.021L53.166 128.0219999999999C60.385 135.694 72.407 136.002 80.022 128.8349999999999L133.034 78.9409999999999C143.225 69.351 160 76.6 160 90.594V160.073C160 161.266 159.866 162.456 159.603 163.619L125.473 313.791C119.877 338.408 156.975 346.651 162.527 322.212L192.926 188.4549999999999A16 16 0 0 1 208.529 176.0009999999999H217.1330000000001C227.4090000000001 176.0009999999999 235.0270000000001 185.5679999999999 232.7270000000001 195.5839999999999L191.107 376.7369999999999C185.484 401.2059999999999 222.497 409.813 228.142 385.2449999999999L273.362 188.4169999999999A16 16 0 0 1 288.956 176H302.173A16 16 0 0 1 317.695 188.119L360.067 357.6090000000001C366.171 382.0310000000001 403.029 372.7680000000001 396.932 348.3920000000001L358.805 195.88C356.284 185.792 363.92 176 374.327 176H384.021A16 16 0 0 1 399.586 188.295L426.509 301.4C432.3300000000001 325.848 469.306 317.087 463.475 292.598L431.7200000000001 159.19A100.094 100.094 0 0 1 429 136.028V99.189C429 92.641 428.057 86.138 426.195 79.8610000000001L397.775 -16H178.465L53.978 101.164C46.349 108.344 45.984 120.393 53.164 128.021z" />
<glyph glyph-name="handshake"
unicode="&#xF2B5;"
horiz-adv-x="640" d=" M519.2 320.1L471.6 367.7A56.252 56.252 0 0 1 432 384H205.2C190.4 384 176.1 378.1 165.6 367.7L118 320.1H0V64.4H64C81.6 64.4 95.8 78.6 95.9 96.1H105L189.6 19.6999999999999C220.5 -5.4000000000001 263.4 -6.0000000000001 295.2 15.8999999999999C307.7 5.0999999999999 321.2 -1e-13 336.3 -1e-13C354.5 -1e-13 371.6 7.3999999999999 385.1 23.9999999999999C407.2000000000001 15.3 433.3 21.3999999999999 449.1 40.8L475.3 73.1C480.9 79.9999999999999 484.4 87.9 486.2 96.1H544.1C544.2 78.6 558.5 64.4 576 64.4H640V320.1H519.2zM48 96.4C39.2 96.4 32 103.6 32 112.4S39.2 128.4 48 128.4S64 121.2 64 112.4C64 103.5 56.8 96.4 48 96.4zM438 103.3L411.9 71.1C409.1 67.7 404.1 67.1 400.6 69.9L376.7 89.3L346.7 52.8C340.7 45.4999999999999 331.7 47.9999999999999 328.7 50.4L291.9 81.9L276.3 62.7C262.4 45.6 237.1 43 221 56.1L123.7 144.1H96V272.2H137.9L199.6 333.8C201.6 334.6 203.3 335.3 205.3 336.1H262L223.3 300.6C193.9 273.7 192.2 228.3 218.9 199.3C233.7 183.1 280.1 158.1 320.4 194.9L328.6 202.4L436.8 114.6C440.2 111.8 440.7 106.7 438 103.3zM544 144.1H474.8C472.5 146.9 469.9 149.5 467.1 151.8L364.4000000000001 235.2L376.9000000000001 246.6C383.4000000000001 252.6 383.9000000000001 262.7 377.9000000000001 269.2L367 280.9C361 287.4 350.9 287.8 344.4 281.9L289.2 231.3C279.7 222.6 263.5 221.9 254.6 231.3C245.3 241.2 246.1 256.4 255.8 265.2000000000001L321.4 325.3C328.8 332.1 338.4 335.8 348.4 335.8L432.1 336C434.2 336 436.2 335.2000000000001 437.6 333.7000000000001L499.3 272.1H544V144.1zM592 96.4C583.2 96.4 576 103.6 576 112.4S583.2 128.4 592 128.4S608 121.2 608 112.4C608 103.5 600.8 96.4 592 96.4z" />
<glyph glyph-name="hdd"
unicode="&#xF0A0;"
horiz-adv-x="576" d=" M567.403 212.358L462.323 363.411A48 48 0 0 1 422.919 384H153.081A48 48 0 0 1 113.677 363.411L8.597 212.358A48.001 48.001 0 0 1 0 184.946V48C0 21.49 21.49 0 48 0H528C554.51 0 576 21.49 576 48V184.946C576 194.747 573 204.312 567.403 212.358zM153.081 336H422.919L500.832 224H75.168L153.081 336zM528 48H48V176H528V48zM496 112C496 94.327 481.673 80 464 80S432 94.327 432 112S446.327 144 464 144S496 129.673 496 112zM400 112C400 94.327 385.673 80 368 80S336 94.327 336 112S350.327 144 368 144S400 129.673 400 112z" />
<glyph glyph-name="heart"
unicode="&#xF004;"
horiz-adv-x="512" d=" M458.4 383.7C400.6 432.3 311.3 425 256 368.7C200.7 425 111.4 432.4 53.6 383.7C-21.6 320.4 -10.6 217.2 43 162.5L218.4 -16.2C228.4 -26.4 241.8 -32.1 256 -32.1C270.3 -32.1 283.6 -26.4999999999999 293.6 -16.3L469 162.4C522.5 217.1 533.7 320.3 458.4 383.7zM434.8 196.2L259.4 17.5C257 15.1 255 15.1 252.6 17.5L77.2 196.2C40.7 233.4 33.3 303.8 84.5 346.9C123.4 379.6 183.4 374.7 221 336.4L256 300.7L291 336.4C328.8 374.9 388.8 379.6 427.5 347C478.6 303.9 471 233.1 434.8 196.2z" />
<glyph glyph-name="hospital"
unicode="&#xF0F8;"
horiz-adv-x="448" d=" M128 204V244C128 250.627 133.373 256 140 256H180C186.627 256 192 250.627 192 244V204C192 197.373 186.627 192 180 192H140C133.373 192 128 197.373 128 204zM268 192H308C314.627 192 320 197.373 320 204V244C320 250.627 314.627 256 308 256H268C261.373 256 256 250.627 256 244V204C256 197.373 261.373 192 268 192zM192 108V148C192 154.627 186.627 160 180 160H140C133.373 160 128 154.627 128 148V108C128 101.373 133.373 96 140 96H180C186.627 96 192 101.373 192 108zM268 96H308C314.627 96 320 101.373 320 108V148C320 154.627 314.627 160 308 160H268C261.373 160 256 154.627 256 148V108C256 101.373 261.373 96 268 96zM448 -28V-64H0V-28C0 -21.373 5.373 -16 12 -16H31.5V362.9650000000001C31.5 374.582 42.245 384 55.5 384H144V424C144 437.255 154.745 448 168 448H280C293.255 448 304 437.255 304 424V384H392.5C405.755 384 416.5 374.582 416.5 362.9650000000001V-16H436C442.627 -16 448 -21.373 448 -28zM79.5 -15H192V52C192 58.627 197.373 64 204 64H244C250.627 64 256 58.627 256 52V-15H368.5V336H304V312C304 298.745 293.255 288 280 288H168C154.745 288 144 298.745 144 312V336H79.5V-15zM266 384H240V410A6 6 0 0 1 234 416H214A6 6 0 0 1 208 410V384H182A6 6 0 0 1 176 378V358A6 6 0 0 1 182 352H208V326A6 6 0 0 1 214 320H234A6 6 0 0 1 240 326V352H266A6 6 0 0 1 272 358V378A6 6 0 0 1 266 384z" />
<glyph glyph-name="hourglass"
unicode="&#xF254;"
horiz-adv-x="384" d=" M368 400H372C378.627 400 384 405.373 384 412V436C384 442.627 378.627 448 372 448H12C5.373 448 0 442.627 0 436V412C0 405.373 5.373 400 12 400H16C16 319.4360000000001 48.188 234.193 113.18 192C47.899 149.619 16 64.1 16 -16H12C5.373 -16 0 -21.373 0 -28V-52C0 -58.627 5.373 -64 12 -64H372C378.627 -64 384 -58.627 384 -52V-28C384 -21.373 378.627 -16 372 -16H368C368 64.564 335.812 149.807 270.82 192C336.102 234.381 368 319.9 368 400zM64 400H320C320 298.38 262.693 216 192 216S64 298.379 64 400zM320 -16H64C64 85.62 121.308 168 192 168S320 85.62 320 -16z" />
<glyph glyph-name="id-badge"
unicode="&#xF2C1;"
horiz-adv-x="384" d=" M336 448H48C21.5 448 0 426.5 0 400V-16C0 -42.5 21.5 -64 48 -64H336C362.5 -64 384 -42.5 384 -16V400C384 426.5 362.5 448 336 448zM336 -16H48V400H336V-16zM144 336H240C248.8 336 256 343.2 256 352S248.8 368 240 368H144C135.2 368 128 360.8 128 352S135.2 336 144 336zM192 160C227.3 160 256 188.7 256 224S227.3 288 192 288S128 259.3 128 224S156.7 160 192 160zM102.4 32H281.6C294 32 304 40.6 304 51.2V70.4C304 102.2 273.9 128 236.8 128C226 128 218.1 120 192 120C165.1 120 158.6 128 147.2 128C110.1 128 80 102.2 80 70.4V51.2C80 40.6 90 32 102.4 32z" />
<glyph glyph-name="id-card"
unicode="&#xF2C2;"
horiz-adv-x="576" d=" M528 416H48C21.5 416 0 394.5 0 368V16C0 -10.5 21.5 -32 48 -32H528C554.5 -32 576 -10.5 576 16V368C576 394.5 554.5 416 528 416zM528 16H303.2C304.1 20.5 304 12.4 304 38.4C304 70.2 273.9 96 236.8 96C226 96 218.1 88 192 88C165.1 88 158.6 96 147.2 96C110.1 96 80 70.2 80 38.4C80 12.4 79.8 20.5 80.8 16H48V304H528V16zM360 96H472C476.4 96 480 99.6 480 104V120C480 124.4 476.4 128 472 128H360C355.6 128 352 124.4 352 120V104C352 99.6 355.6 96 360 96zM360 160H472C476.4 160 480 163.6 480 168V184C480 188.4 476.4 192 472 192H360C355.6 192 352 188.4 352 184V168C352 163.6 355.6 160 360 160zM360 224H472C476.4 224 480 227.6 480 232V248C480 252.4 476.4 256 472 256H360C355.6 256 352 252.4 352 248V232C352 227.6 355.6 224 360 224zM192 128C227.3 128 256 156.7 256 192S227.3 256 192 256S128 227.3 128 192S156.7 128 192 128z" />
<glyph glyph-name="image"
unicode="&#xF03E;"
horiz-adv-x="512" d=" M464 384H48C21.49 384 0 362.51 0 336V48C0 21.49 21.49 0 48 0H464C490.51 0 512 21.49 512 48V336C512 362.51 490.51 384 464 384zM458 48H54A6 6 0 0 0 48 54V330A6 6 0 0 0 54 336H458A6 6 0 0 0 464 330V54A6 6 0 0 0 458 48zM128 296C105.909 296 88 278.091 88 256S105.909 216 128 216S168 233.909 168 256S150.091 296 128 296zM96 96H416V176L328.485 263.515C323.7990000000001 268.201 316.201 268.201 311.514 263.515L192 144L152.485 183.515C147.799 188.201 140.201 188.201 135.514 183.515L96 144V96z" />
<glyph glyph-name="images"
unicode="&#xF302;"
horiz-adv-x="576" d=" M480 32V16C480 -10.51 458.51 -32 432 -32H48C21.49 -32 0 -10.51 0 16V272C0 298.51 21.49 320 48 320H64V272H54A6 6 0 0 1 48 266V22A6 6 0 0 1 54 16H426A6 6 0 0 1 432 22V32H480zM522 368H150A6 6 0 0 1 144 362V118A6 6 0 0 1 150 112H522A6 6 0 0 1 528 118V362A6 6 0 0 1 522 368zM528 416C554.51 416 576 394.51 576 368V112C576 85.49 554.51 64 528 64H144C117.49 64 96 85.49 96 112V368C96 394.51 117.49 416 144 416H528zM264 304C264 281.909 246.091 264 224 264S184 281.909 184 304S201.909 344 224 344S264 326.091 264 304zM192 208L231.515 247.515C236.201 252.201 243.799 252.201 248.486 247.515L288 208L391.515 311.515C396.201 316.201 403.799 316.201 408.486 311.515L480 240V160H192V208z" />
<glyph glyph-name="keyboard"
unicode="&#xF11C;"
horiz-adv-x="576" d=" M528 384H48C21.49 384 0 362.51 0 336V48C0 21.49 21.49 0 48 0H528C554.51 0 576 21.49 576 48V336C576 362.51 554.51 384 528 384zM536 48C536 43.589 532.411 40 528 40H48C43.589 40 40 43.589 40 48V336C40 340.411 43.589 344 48 344H528C532.411 344 536 340.411 536 336V48zM170 178V206C170 212.627 164.627 218 158 218H130C123.373 218 118 212.627 118 206V178C118 171.373 123.373 166 130 166H158C164.627 166 170 171.373 170 178zM266 178V206C266 212.627 260.627 218 254 218H226C219.373 218 214 212.627 214 206V178C214 171.373 219.373 166 226 166H254C260.627 166 266 171.373 266 178zM362 178V206C362 212.627 356.627 218 350 218H322C315.373 218 310 212.627 310 206V178C310 171.373 315.373 166 322 166H350C356.627 166 362 171.373 362 178zM458 178V206C458 212.627 452.627 218 446 218H418C411.373 218 406 212.627 406 206V178C406 171.373 411.373 166 418 166H446C452.627 166 458 171.373 458 178zM122 96V124C122 130.627 116.627 136 110 136H82C75.373 136 70 130.627 70 124V96C70 89.373 75.373 84 82 84H110C116.627 84 122 89.373 122 96zM506 96V124C506 130.627 500.627 136 494 136H466C459.373 136 454 130.627 454 124V96C454 89.373 459.373 84 466 84H494C500.627 84 506 89.373 506 96zM122 260V288C122 294.627 116.627 300 110 300H82C75.373 300 70 294.627 70 288V260C70 253.373 75.373 248 82 248H110C116.627 248 122 253.373 122 260zM218 260V288C218 294.627 212.627 300 206 300H178C171.373 300 166 294.627 166 288V260C166 253.373 171.373 248 178 248H206C212.627 248 218 253.373 218 260zM314 260V288C314 294.627 308.627 300 302 300H274C267.373 300 262 294.627 262 288V260C262 253.373 267.373 248 274 248H302C308.627 248 314 253.373 314 260zM410 260V288C410 294.627 404.627 300 398 300H370C363.373 300 358 294.627 358 288V260C358 253.373 363.373 248 370 248H398C404.627 248 410 253.373 410 260zM506 260V288C506 294.627 500.627 300 494 300H466C459.373 300 454 294.627 454 288V260C454 253.373 459.373 248 466 248H494C500.627 248 506 253.373 506 260zM408 102V118C408 124.627 402.627 130 396 130H180C173.373 130 168 124.627 168 118V102C168 95.373 173.373 90 180 90H396C402.627 90 408 95.373 408 102z" />
<glyph glyph-name="lemon"
unicode="&#xF094;"
horiz-adv-x="512" d=" M484.112 420.111C455.989 448.233 416.108 456.057 387.0590000000001 439.135C347.604 416.152 223.504 489.111 91.196 356.803C-41.277 224.328 31.923 100.528 8.866 60.942C-8.056 31.891 -0.234 -7.99 27.888 -36.112C56.023 -64.247 95.899 -72.0499999999999 124.945 -55.133C164.368 -32.163 288.502 -105.102 420.803 27.196C553.277 159.673 480.076 283.473 503.134 323.057C520.056 352.1070000000001 512.234 391.988 484.112 420.111zM461.707 347.217C422.907 280.608 507.307 181.582 386.862 61.137C266.422 -59.306 167.387 25.089 100.786 -13.706C78.1069999999999 -26.913 36.751 13.535 50.2929999999999 36.782C89.0929999999999 103.391 4.6929999999999 202.417 125.138 322.862C245.573 443.298 344.616 358.914 411.219 397.708C433.949 410.948 475.224 370.42 461.707 347.217zM291.846 338.481C293.216 327.521 285.442 317.524 274.481 316.154C219.635 309.299 138.702 228.367 131.846 173.519C130.473 162.53 120.447 154.785 109.52 156.154C98.559 157.524 90.785 167.52 92.155 178.48C101.317 251.766 196.322 346.6950000000001 269.5200000000001 355.8450000000001C280.473 357.213 290.4760000000001 349.442 291.8460000000001 338.481z" />
<glyph glyph-name="life-ring"
unicode="&#xF1CD;"
horiz-adv-x="512" d=" M256 -56C392.967 -56 504 55.033 504 192S392.967 440 256 440S8 328.967 8 192S119.033 -56 256 -56zM152.602 20.72L206.013 74.131C237.819 60.625 274.141 60.609 305.987 74.131L359.398 20.72C296.1810000000001 -17.599 215.819 -17.599 152.602 20.72zM336 192C336 147.888 300.112 112 256 112S176 147.888 176 192S211.888 272 256 272S336 236.112 336 192zM427.28 88.602L373.869 142.013C387.374 173.819 387.391 210.141 373.869 241.987L427.28 295.398C465.599 232.181 465.599 151.819 427.28 88.602zM359.397 363.28L305.986 309.8690000000001C274.18 323.374 237.858 323.391 206.013 309.8690000000001L152.602 363.28C215.819 401.599 296.1810000000001 401.599 359.397 363.28zM84.72 295.398L138.131 241.987C124.625 210.181 124.609 173.859 138.131 142.013L84.72 88.602C46.401 151.819 46.401 232.181 84.72 295.398z" />
<glyph glyph-name="lightbulb"
unicode="&#xF0EB;"
horiz-adv-x="384" d=" M272 20V-8C272 -18.449 265.32 -27.334 256 -30.629V-40C256 -53.255 245.255 -64 232 -64H152C138.745 -64 128 -53.255 128 -40V-30.629C118.68 -27.334 112 -18.449 112 -8V20C112 26.627 117.373 32 124 32H260C266.627 32 272 26.627 272 20zM128 272C128 307.29 156.71 336 192 336C200.837 336 208 343.164 208 352S200.837 368 192 368C139.065 368 96 324.935 96 272C96 263.164 103.164 256 112 256S128 263.164 128 272zM192 400C262.734 400 320 342.746 320 272C320 194.398 282.617 211.523 239.02 112H144.98C101.318 211.67 64 194.131 64 272C64 342.735 121.254 400 192 400M192 448C94.805 448 16 369.197 16 272C16 170.269 67.697 180.459 106.516 79.326C110.066 70.077 118.986 64 128.892 64H255.107C265.013 64 273.933 70.078 277.483 79.326C316.303 180.459 368 170.269 368 272C368 369.197 289.195 448 192 448z" />
<glyph glyph-name="list-alt"
unicode="&#xF022;"
horiz-adv-x="512" d=" M464 416H48C21.49 416 0 394.51 0 368V16C0 -10.51 21.49 -32 48 -32H464C490.51 -32 512 -10.51 512 16V368C512 394.51 490.51 416 464 416zM458 16H54A6 6 0 0 0 48 22V362A6 6 0 0 0 54 368H458A6 6 0 0 0 464 362V22A6 6 0 0 0 458 16zM416 108V84C416 77.373 410.627 72 404 72H204C197.373 72 192 77.373 192 84V108C192 114.627 197.373 120 204 120H404C410.627 120 416 114.627 416 108zM416 204V180C416 173.373 410.627 168 404 168H204C197.373 168 192 173.373 192 180V204C192 210.627 197.373 216 204 216H404C410.627 216 416 210.627 416 204zM416 300V276C416 269.373 410.627 264 404 264H204C197.373 264 192 269.373 192 276V300C192 306.627 197.373 312 204 312H404C410.627 312 416 306.627 416 300zM164 288C164 268.118 147.882 252 128 252S92 268.118 92 288S108.118 324 128 324S164 307.882 164 288zM164 192C164 172.118 147.882 156 128 156S92 172.118 92 192S108.118 228 128 228S164 211.882 164 192zM164 96C164 76.118 147.882 60 128 60S92 76.118 92 96S108.118 132 128 132S164 115.882 164 96z" />
<glyph glyph-name="map"
unicode="&#xF279;"
horiz-adv-x="576" d=" M508.505 411.83L381.517 355.424L207.179 413.537A47.992 47.992 0 0 1 172.505 411.863L28.505 347.863A48 48 0 0 1 0 304V16.033C0 -18.905 35.991 -41.831 67.495 -27.83L194.483 28.576L368.822 -29.537A47.992 47.992 0 0 1 403.496 -27.863L547.496 36.137A48 48 0 0 1 576 80V367.967C576 402.905 540.009 425.831 508.505 411.83zM360 24L216 72V360L360 312V24zM48 16V304L168 357.333V69.333L48 16zM528 80L408 26.667V314.6670000000001L528 368V80z" />
<glyph glyph-name="meh"
unicode="&#xF11A;"
horiz-adv-x="496" d=" M248 440C111 440 0 329 0 192S111 -56 248 -56S496 55 496 192S385 440 248 440zM248 -8C137.7 -8 48 81.7 48 192S137.7 392 248 392S448 302.3 448 192S358.3 -8 248 -8zM168 208C185.7 208 200 222.3 200 240S185.7 272 168 272S136 257.7 136 240S150.3 208 168 208zM328 272C310.3 272 296 257.7 296 240S310.3 208 328 208S360 222.3 360 240S345.7 272 328 272zM336 128H160C146.8 128 136 117.2 136 104S146.8 80 160 80H336C349.2 80 360 90.8 360 104S349.2 128 336 128z" />
<glyph glyph-name="minus-square"
unicode="&#xF146;"
horiz-adv-x="448" d=" M108 164C101.4 164 96 169.4 96 176V208C96 214.6 101.4 220 108 220H340C346.6 220 352 214.6 352 208V176C352 169.4 346.6 164 340 164H108zM448 368V16C448 -10.5 426.5 -32 400 -32H48C21.5 -32 0 -10.5 0 16V368C0 394.5 21.5 416 48 416H400C426.5 416 448 394.5 448 368zM400 22V362C400 365.3 397.3 368 394 368H54C50.7 368 48 365.3 48 362V22C48 18.7 50.7 16 54 16H394C397.3 16 400 18.7 400 22z" />
<glyph glyph-name="money-bill-alt"
unicode="&#xF3D1;"
horiz-adv-x="640" d=" M320 304C266.98 304 224 253.86 224 192C224 130.15 266.98 80 320 80C373 80 416 130.13 416 192C416 253.86 373.02 304 320 304zM360 136C360 131.58 356.42 128 352 128H288C283.58 128 280 131.58 280 136V152C280 156.42 283.58 160 288 160H304V215.44L303.53 215.13A7.991999999999999 7.991999999999999 0 0 0 292.44 217.35L283.56 230.66A7.991999999999999 7.991999999999999 0 0 0 285.7800000000001 241.75L301.11 251.97A23.99 23.99 0 0 0 314.42 256H328C332.42 256 336 252.42 336 248V160H352C356.42 160 360 156.42 360 152V136zM608 384H32C14.33 384 0 369.67 0 352V32C0 14.33 14.33 0 32 0H608C625.67 0 640 14.33 640 32V352C640 369.67 625.67 384 608 384zM592 112C556.65 112 528 83.35 528 48H112C112 83.35 83.35 112 48 112V272C83.35 272 112 300.65 112 336H528C528 300.65 556.65 272 592 272V112z" />
<glyph glyph-name="moon"
unicode="&#xF186;"
horiz-adv-x="512" d=" M279.135 -64C357.891 -64 430.117 -28.196 477.979 30.775C506.249 65.606 475.421 116.497 431.73 108.176C349.382 92.493 273.458 155.444 273.458 238.968C273.458 287.392 299.518 331.26 340.892 354.804C379.637 376.854 369.891 435.592 325.87 443.723A257.936 257.936 0 0 1 279.135 448C137.775 448 23.135 333.425 23.135 192C23.135 50.64 137.711 -64 279.135 -64zM279.135 400C292.12 400 304.824 398.799 317.151 396.522C262.391 365.359 225.4580000000001 306.48 225.4580000000001 238.968C225.4580000000001 125.12 329.0990000000001 39.768 440.7100000000001 61.024C402.574 14.036 344.366 -16 279.135 -16C164.26 -16 71.135 77.125 71.135 192S164.26 400 279.135 400z" />
<glyph glyph-name="newspaper"
unicode="&#xF1EA;"
horiz-adv-x="576" d=" M552 384H112C91.142 384 73.357 370.623 66.752 352H24C10.745 352 0 341.255 0 328V56C0 25.072 25.072 0 56 0H552C565.255 0 576 10.745 576 24V360C576 373.255 565.255 384 552 384zM48 56V304H64V56C64 51.589 60.411 48 56 48S48 51.589 48 56zM528 48H111.422C111.796 50.614 112 53.283 112 56V336H528V48zM172 168H308C314.627 168 320 173.373 320 180V276C320 282.627 314.627 288 308 288H172C165.373 288 160 282.627 160 276V180C160 173.373 165.373 168 172 168zM200 248H280V208H200V248zM160 108V132C160 138.627 165.373 144 172 144H308C314.627 144 320 138.627 320 132V108C320 101.373 314.627 96 308 96H172C165.373 96 160 101.373 160 108zM352 108V132C352 138.627 357.373 144 364 144H468C474.627 144 480 138.627 480 132V108C480 101.373 474.627 96 468 96H364C357.373 96 352 101.373 352 108zM352 252V276C352 282.627 357.373 288 364 288H468C474.627 288 480 282.627 480 276V252C480 245.373 474.627 240 468 240H364C357.373 240 352 245.373 352 252zM352 180V204C352 210.627 357.373 216 364 216H468C474.627 216 480 210.627 480 204V180C480 173.373 474.627 168 468 168H364C357.373 168 352 173.373 352 180z" />
<glyph glyph-name="object-group"
unicode="&#xF247;"
horiz-adv-x="512" d=" M500 320C506.627 320 512 325.373 512 332V404C512 410.627 506.627 416 500 416H428C421.373 416 416 410.627 416 404V392H96V404C96 410.627 90.627 416 84 416H12C5.373 416 0 410.627 0 404V332C0 325.373 5.373 320 12 320H24V64H12C5.373 64 0 58.627 0 52V-20C0 -26.627 5.373 -32 12 -32H84C90.627 -32 96 -26.627 96 -20V-8H416V-20C416 -26.627 421.373 -32 428 -32H500C506.627 -32 512 -26.627 512 -20V52C512 58.627 506.627 64 500 64H488V320H500zM448 384H480V352H448V384zM32 384H64V352H32V384zM64 0H32V32H64V0zM480 0H448V32H480V0zM440 64H428C421.373 64 416 58.627 416 52V40H96V52C96 58.627 90.627 64 84 64H72V320H84C90.627 320 96 325.373 96 332V344H416V332C416 325.373 421.373 320 428 320H440V64zM404 256H320V308C320 314.628 314.627 320 308 320H108C101.373 320 96 314.628 96 308V140C96 133.372 101.373 128 108 128H192V76C192 69.372 197.373 64 204 64H404C410.627 64 416 69.372 416 76V244C416 250.628 410.627 256 404 256zM136 280H280V168H136V280zM376 104H232V128H308C314.627 128 320 133.372 320 140V216H376V104z" />
<glyph glyph-name="object-ungroup"
unicode="&#xF248;"
horiz-adv-x="576" d=" M564 224C570.627 224 576 229.373 576 236V308C576 314.627 570.627 320 564 320H492C485.373 320 480 314.627 480 308V296H392V320H404C410.627 320 416 325.373 416 332V404C416 410.627 410.627 416 404 416H332C325.373 416 320 410.627 320 404V392H96V404C96 410.627 90.627 416 84 416H12C5.373 416 0 410.627 0 404V332C0 325.373 5.373 320 12 320H24V160H12C5.373 160 0 154.627 0 148V76C0 69.373 5.373 64 12 64H84C90.627 64 96 69.373 96 76V88H184V64H172C165.373 64 160 58.627 160 52V-20C160 -26.627 165.373 -32 172 -32H244C250.627 -32 256 -26.627 256 -20V-8H480V-20C480 -26.627 485.373 -32 492 -32H564C570.627 -32 576 -26.627 576 -20V52C576 58.627 570.627 64 564 64H552V224H564zM352 384H384V352H352V384zM352 128H384V96H352V128zM64 96H32V128H64V96zM64 352H32V384H64V352zM96 136V148C96 154.627 90.627 160 84 160H72V320H84C90.627 320 96 325.373 96 332V344H320V332C320 325.373 325.373 320 332 320H344V160H332C325.373 160 320 154.627 320 148V136H96zM224 0H192V32H224V0zM504 64H492C485.373 64 480 58.627 480 52V40H256V52C256 58.627 250.627 64 244 64H232V88H320V76C320 69.373 325.373 64 332 64H404C410.627 64 416 69.373 416 76V148C416 154.627 410.627 160 404 160H392V248H480V236C480 229.373 485.373 224 492 224H504V64zM544 0H512V32H544V0zM544 256H512V288H544V256z" />
<glyph glyph-name="paper-plane"
unicode="&#xF1D8;"
horiz-adv-x="512" d=" M440 441.5L24 201.6C-10.4 181.7 -7.1 130.8 29.7 115.7L144 68.4V-16C144 -62.4 203.2 -81.5 230.6 -44.6L274.4 14.5L386.3 -31.7C392.2 -34.1 398.4 -35.3 404.6 -35.3C412.8 -35.3 420.9 -33.2 428.2 -29.1C441 -21.9 449.8 -9.1 452.1 5.4L511.4999999999999 392.6C517.5999999999999 432.7 474.6 461.4 440 441.5zM192 -16V48.6L228.6 33.5L192 -16zM404.6 12.7L250.8 76.2L391 278.5C401.7 294 381.5 312 367.3 299.7L155.8 115.4L48 160L464 400L404.6 12.7z" />
<glyph glyph-name="pause-circle"
unicode="&#xF28B;"
horiz-adv-x="512" d=" M256 440C119 440 8 329 8 192S119 -56 256 -56S504 55 504 192S393 440 256 440zM256 -8C145.5 -8 56 81.5 56 192S145.5 392 256 392S456 302.5 456 192S366.5 -8 256 -8zM352 272V112C352 103.2 344.8 96 336 96H288C279.2 96 272 103.2 272 112V272C272 280.8 279.2 288 288 288H336C344.8 288 352 280.8 352 272zM240 272V112C240 103.2 232.8 96 224 96H176C167.2 96 160 103.2 160 112V272C160 280.8 167.2 288 176 288H224C232.8 288 240 280.8 240 272z" />
<glyph glyph-name="play-circle"
unicode="&#xF144;"
horiz-adv-x="512" d=" M371.7 210L195.7 317C179.9 325.8 160 314.5 160 296V88C160 69.6 179.8 58.2 195.7 67L371.7 168C388.1 177.1 388.1 200.8 371.7 210zM504 192C504 329 393 440 256 440S8 329 8 192S119 -56 256 -56S504 55 504 192zM56 192C56 302.5 145.5 392 256 392S456 302.5 456 192S366.5 -8 256 -8S56 81.5 56 192z" />
<glyph glyph-name="plus-square"
unicode="&#xF0FE;"
horiz-adv-x="448" d=" M352 208V176C352 169.4 346.6 164 340 164H252V76C252 69.4 246.6 64 240 64H208C201.4 64 196 69.4 196 76V164H108C101.4 164 96 169.4 96 176V208C96 214.6 101.4 220 108 220H196V308C196 314.6 201.4 320 208 320H240C246.6 320 252 314.6 252 308V220H340C346.6 220 352 214.6 352 208zM448 368V16C448 -10.5 426.5 -32 400 -32H48C21.5 -32 0 -10.5 0 16V368C0 394.5 21.5 416 48 416H400C426.5 416 448 394.5 448 368zM400 22V362C400 365.3 397.3 368 394 368H54C50.7 368 48 365.3 48 362V22C48 18.7 50.7 16 54 16H394C397.3 16 400 18.7 400 22z" />
<glyph glyph-name="question-circle"
unicode="&#xF059;"
horiz-adv-x="512" d=" M256 440C119.043 440 8 328.9170000000001 8 192C8 55.003 119.043 -56 256 -56S504 55.003 504 192C504 328.9170000000001 392.957 440 256 440zM256 -8C145.468 -8 56 81.431 56 192C56 302.495 145.472 392 256 392C366.491 392 456 302.529 456 192C456 81.47 366.569 -8 256 -8zM363.2440000000001 247.2C363.2440000000001 180.148 290.8230000000001 179.116 290.8230000000001 154.337V148C290.8230000000001 141.373 285.4500000000001 136 278.8230000000001 136H233.1760000000001C226.5490000000001 136 221.1760000000001 141.373 221.1760000000001 148V156.659C221.1760000000001 192.404 248.2760000000001 206.693 268.7550000000001 218.175C286.3160000000001 228.02 297.0790000000001 234.716 297.0790000000001 247.754C297.0790000000001 265 275.0800000000001 276.447 257.2950000000001 276.447C234.1060000000001 276.447 223.4010000000001 265.4700000000001 208.3530000000001 246.478C204.2960000000001 241.358 196.8930000000001 240.407 191.6870000000001 244.354L163.8630000000001 265.452C158.7560000000001 269.324 157.6120000000001 276.5180000000001 161.2190000000001 281.815C184.846 316.509 214.94 336 261.794 336C310.865 336 363.244 297.6960000000001 363.244 247.2zM298 80C298 56.841 279.159 38 256 38S214 56.841 214 80S232.841 122 256 122S298 103.159 298 80z" />
<glyph glyph-name="registered"
unicode="&#xF25D;"
horiz-adv-x="512" d=" M256 440C119.033 440 8 328.967 8 192S119.033 -56 256 -56S504 55.033 504 192S392.967 440 256 440zM256 -8C145.468 -8 56 81.451 56 192C56 302.531 145.451 392 256 392C366.532 392 456 302.549 456 192C456 81.468 366.549 -8 256 -8zM366.442 73.791C313.396 170.075 316.192 165.259 313.171 169.876C337.438 183.755 352.653 211.439 352.653 243.052C352.653 295.555 322.406 328.304 251.1550000000001 328.304H172.488C165.8710000000001 328.304 160.488 322.921 160.488 316.304V68C160.488 61.383 165.8710000000001 56 172.488 56H211.0560000000001C217.673 56 223.0560000000001 61.383 223.0560000000001 68V151.663H255.0140000000001L302.5290000000001 62.36A11.98 11.98 0 0 1 313.1220000000001 56H355.9320000000001C365.0720000000001 56 370.8460000000001 65.799 366.4420000000001 73.791zM256.933 208.094H223.058V272.234H250.435C282.852 272.234 289.3640000000001 260.101 289.3640000000001 240.525C289.3630000000001 219.612 277.846 208.094 256.9330000000001 208.094z" />
<glyph glyph-name="save"
unicode="&#xF0C7;"
horiz-adv-x="448" d=" M433.941 318.059L350.059 401.9410000000001A48 48 0 0 1 316.118 416H48C21.49 416 0 394.51 0 368V16C0 -10.51 21.49 -32 48 -32H400C426.51 -32 448 -10.51 448 16V284.118A48 48 0 0 1 433.941 318.059zM272 368V288H144V368H272zM394 16H54A6 6 0 0 0 48 22V362A6 6 0 0 0 54 368H96V264C96 250.745 106.745 240 120 240H296C309.255 240 320 250.745 320 264V364.118L398.243 285.875A6 6 0 0 0 400 281.632V22A6 6 0 0 0 394 16zM224 216C175.477 216 136 176.523 136 128S175.477 40 224 40S312 79.477 312 128S272.523 216 224 216zM224 88C201.944 88 184 105.944 184 128S201.944 168 224 168S264 150.056 264 128S246.056 88 224 88z" />
<glyph glyph-name="share-square"
unicode="&#xF14D;"
horiz-adv-x="576" d=" M561.938 289.94L417.94 433.908C387.926 463.922 336 442.903 336 399.968V342.77C293.55 340.89 251.97 336.2200000000001 215.24 324.7800000000001C180.07 313.8300000000001 152.17 297.2000000000001 132.33 275.36C108.22 248.8 96 215.4 96 176.06C96 114.363 129.178 63.605 180.87 31.3C218.416 7.792 266.118 43.951 251.89 87.04C236.375 134.159 234.734 157.963 336 165.8V112C336 69.007 387.968 48.087 417.94 78.06L561.938 222.06C580.688 240.8 580.688 271.2 561.938 289.94zM384 112V215.84C255.309 213.918 166.492 192.65 206.31 72C176.79 90.45 144 123.92 144 176.06C144 285.394 273.14 295.007 384 295.91V400L528 256L384 112zM408.74 27.507A82.658 82.658 0 0 1 429.714 36.81C437.69 41.762 448 35.984 448 26.596V-16C448 -42.51 426.51 -64 400 -64H48C21.49 -64 0 -42.51 0 -16V336C0 362.51 21.49 384 48 384H180C186.627 384 192 378.627 192 372V367.514C192 362.597 189.013 358.145 184.431 356.362C170.729 351.031 158.035 344.825 146.381 337.777A12.138 12.138 0 0 0 140.101 336H54A6 6 0 0 1 48 330V-10A6 6 0 0 1 54 -16H394A6 6 0 0 1 400 -10V15.966C400 21.336 403.579 26.025 408.74 27.507z" />
<glyph glyph-name="smile"
unicode="&#xF118;"
horiz-adv-x="496" d=" M248 440C111 440 0 329 0 192S111 -56 248 -56S496 55 496 192S385 440 248 440zM248 -8C137.7 -8 48 81.7 48 192S137.7 392 248 392S448 302.3 448 192S358.3 -8 248 -8zM332 135.4C311.2 110.4 280.5 96 248 96S184.8 110.3 164 135.4C155.5 145.6 140.4 146.9 130.2 138.5C120 130 118.7 114.9 127.1 104.7C157.1 68.7 201.2 48.1 248 48.1S338.9 68.7 368.9 104.7C377.4 114.9 376 130 365.8 138.5C355.6 146.9 340.5 145.6 332 135.4zM168 208C185.7 208 200 222.3 200 240S185.7 272 168 272S136 257.7 136 240S150.3 208 168 208zM328 208C345.7 208 360 222.3 360 240S345.7 272 328 272S296 257.7 296 240S310.3 208 328 208z" />
<glyph glyph-name="snowflake"
unicode="&#xF2DC;"
horiz-adv-x="448" d=" M438.237 92.073L371.663 130.613L431.111 140.94C436.957 142.315 441.72 146.123 444.569 151.07C447.0490000000001 155.377 448.075 160.548 447.093 165.721C444.983 176.836 434.4070000000001 183.76 423.4720000000001 181.188L338.0490000000001 150.073L255.914 192L338.05 233.926L423.473 202.811C434.409 200.239 444.985 207.163 447.094 218.278C449.205 229.393 442.048 240.487 431.113 243.059L371.665 253.386L438.238 291.926C447.778 297.449 450.853 310.018 445.105 320C439.357 329.982 426.965 333.596 417.425 328.074L350.851 289.534L371.656 346.3210000000001C374.902 357.103 368.898 368.863 358.243 372.589C347.589 376.314 336.3209999999999 370.592 333.075 359.81L317.2369999999999 270.075L244.8139999999999 228.149V312L314.3989999999999 370.621C322.0879999999999 378.831 321.3959999999999 391.4770000000001 312.8509999999999 398.866C304.3059999999999 406.257 291.1459999999999 405.589 283.4569999999999 397.38L244.8129999999999 350.92V428C244.8129999999999 439.046 235.4949999999999 448 223.9999999999999 448S203.1869999999999 439.046 203.1869999999999 428V350.92L164.5429999999999 397.38C156.8539999999999 405.5900000000001 143.6939999999999 406.256 135.1489999999999 398.866C126.6049999999999 391.477 125.9129999999999 378.831 133.6019999999999 370.621L203.187 312V228.147L130.764 270.073L114.926 359.809C111.679 370.591 100.411 376.313 89.757 372.588C79.101 368.863 73.098 357.102 76.344 346.32L97.149 289.533L30.576 328.073C21.036 333.596 8.643 329.981 2.896 319.999S0.223 297.448 9.763 291.925L76.337 253.385L16.888 243.057C5.953 240.485 -1.202 229.391 0.907 218.276C3.017 207.162 13.593 200.238 24.529 202.81L109.951 233.925L192.086 192L109.95 150.074L24.527 181.189C13.591 183.761 3.016 176.8370000000001 0.905 165.723C-1.204 154.61 5.951 143.514 16.886 140.942L76.335 130.614L9.761 92.074C0.223 86.551 -2.852 73.982 2.896 64S21.036 50.403 30.576 55.926L97.15 94.466L76.345 37.68C74.61 31.916 75.517 25.875 78.365 20.929C80.845 16.622 84.798 13.145 89.757 11.412C100.412 7.687 111.68 13.409 114.926 24.191L130.764 113.927L203.187 155.853V72L133.602 13.379C125.912 5.169 126.605 -7.476 135.149 -14.866C143.693 -22.254 156.854 -21.589 164.543 -13.379L203.187 33.081V-44C203.187 -55.046 212.505 -64 224 -64S244.813 -55.046 244.813 -44V33.081L283.457 -13.379C287.568 -17.768 293.2389999999999 -19.9999999999999 298.935 -19.9999999999999C303.8949999999999 -19.9999999999999 308.874 -18.3059999999999 312.851 -14.8659999999999C321.396 -7.4759999999999 322.088 5.1690000000001 314.399 13.3790000000001L244.813 72V155.853L317.236 113.927L333.074 24.191C336.32 13.409 347.588 7.687 358.242 11.412C368.8950000000001 15.138 374.901 26.8990000000001 371.654 37.6800000000001L350.849 94.467L417.423 55.927C426.963 50.404 439.356 54.019 445.103 64.001C450.852 73.982 447.778 86.5510000000001 438.237 92.073z" />
<glyph glyph-name="square"
unicode="&#xF0C8;"
horiz-adv-x="448" d=" M400 416H48C21.5 416 0 394.5 0 368V16C0 -10.5 21.5 -32 48 -32H400C426.5 -32 448 -10.5 448 16V368C448 394.5 426.5 416 400 416zM394 16H54C50.7 16 48 18.7 48 22V362C48 365.3 50.7 368 54 368H394C397.3 368 400 365.3 400 362V22C400 18.7 397.3 16 394 16z" />
<glyph glyph-name="star-half"
unicode="&#xF089;"
horiz-adv-x="576" d=" M288 62.7L163.7 -2.7L187.4 135.6999999999999L86.8 233.7L225.8 253.8999999999999L288 379.8999999999999V448C276.6 448 265.2 442.1 259.3 430.2L194 297.8L47.9 276.6C21.7 272.8 11.2 240.5 30.2 222L135.9 119L110.9 -26.5C106.4 -52.6 133.9 -72.5 157.3 -60.2L288 8.4V62.7z" />
<glyph glyph-name="star"
unicode="&#xF005;"
horiz-adv-x="576" d=" M528.1 276.5L382 297.8L316.7 430.2C305 453.8 271.1 454.1 259.3 430.2L194 297.8L47.9 276.5C21.7 272.7 11.2 240.4 30.2 221.9L135.9 118.9L110.9 -26.6C106.4 -52.9 134.1 -72.6 157.3 -60.3L288 8.4L418.7 -60.3C441.9 -72.5 469.6 -52.9 465.1 -26.6L440.1 118.9L545.8 221.9C564.8 240.4 554.3 272.7 528.0999999999999 276.5zM388.6 135.7L412.3 -2.7L288 62.6L163.7 -2.7L187.4 135.7000000000001L86.8 233.7000000000001L225.8 253.9000000000001L288 379.9000000000001L350.2 253.9000000000001L489.2 233.7000000000001L388.6 135.7000000000001z" />
<glyph glyph-name="sticky-note"
unicode="&#xF249;"
horiz-adv-x="448" d=" M448 99.894V368C448 394.51 426.51 416 400 416H48C21.49 416 0 394.51 0 368V16.012C0 -10.498 21.49 -31.988 48 -31.988H316.118A48 48 0 0 1 350.059 -17.929L433.941 65.953A48 48 0 0 1 448 99.894zM320 19.894V96.012H396.118L320 19.894zM400 368V144.012H296C282.745 144.012 272 133.267 272 120.012V16.012H48V368H400z" />
<glyph glyph-name="stop-circle"
unicode="&#xF28D;"
horiz-adv-x="512" d=" M504 192C504 329 393 440 256 440S8 329 8 192S119 -56 256 -56S504 55 504 192zM56 192C56 302.5 145.5 392 256 392S456 302.5 456 192S366.5 -8 256 -8S56 81.5 56 192zM352 272V112C352 103.2 344.8 96 336 96H176C167.2 96 160 103.2 160 112V272C160 280.8 167.2 288 176 288H336C344.8 288 352 280.8 352 272z" />
<glyph glyph-name="sun"
unicode="&#xF185;"
horiz-adv-x="512" d=" M220.116 -39.936L199.903 9.489A3.9920000000000004 3.9920000000000004 0 0 1 194.095 11.3750000000001L148.691 -16.7289999999999C119.225 -34.9689999999999 82.396 -8.2099999999999 90.637 25.45L103.336 77.3150000000001A3.9930000000000003 3.9930000000000003 0 0 1 99.746 82.256L46.495 86.2070000000001C11.941 88.7690000000001 -2.137 132.0620000000001 24.321 154.4540000000001L65.08 188.95A3.9920000000000004 3.9920000000000004 0 0 1 65.08 195.056L24.32 229.553C-2.13 251.937 11.93 295.235 46.494 297.799L99.745 301.75A3.9930000000000003 3.9930000000000003 0 0 1 103.335 306.691L90.637 358.557C82.398 392.213 119.218 418.977 148.691 400.736L194.094 372.632A3.9930000000000003 3.9930000000000003 0 0 1 199.902 374.519L220.115 423.944C233.231 456.015 278.753 456.025 291.873 423.944L312.085 374.52A3.9939999999999998 3.9939999999999998 0 0 1 317.894 372.6330000000001L363.2970000000001 400.737C392.761 418.973 429.5940000000001 392.224 421.351 358.558L408.652 306.693A3.9950000000000006 3.9950000000000006 0 0 1 412.242 301.752L465.4929999999999 297.8010000000001C500.0459999999999 295.2380000000001 514.126 251.947 487.6679999999999 229.555L446.908 195.058A3.9930000000000003 3.9930000000000003 0 0 1 446.908 188.951L487.6679999999999 154.455C514.179 132.014 499.99 88.766 465.4929999999999 86.208L412.242 82.257A3.9930000000000003 3.9930000000000003 0 0 1 408.653 77.3149999999999L421.351 25.451C429.592 -8.207 392.7679999999999 -34.97 363.2969999999999 -16.729L317.8939999999999 11.3749999999999A3.9939999999999998 3.9939999999999998 0 0 1 312.0849999999999 9.4879999999999L291.8729999999999 -39.936C278.7139999999999 -72.114 233.1979999999999 -71.9290000000001 220.1159999999999 -39.936zM236.93 24.632L255.994 -21.984L275.058 24.631C285.366 49.831 315.836 59.697 338.95 45.39L381.772 18.883L369.796 67.802C363.321 94.246 382.176 120.141 409.283 122.151L459.509 125.877L421.065 158.413C400.283 176.004 400.318 208.034 421.066 225.593L459.508 258.129L409.283 261.856C382.132 263.871 363.333 289.8040000000001 369.795 316.2050000000001L381.773 365.124L338.95 338.617C315.799 324.29 285.347 334.217 275.058 359.377L255.994 405.992L236.93 359.375C226.625 334.177 196.152 324.3090000000001 173.039 338.615L130.216 365.123L142.193 316.2050000000001C148.667 289.759 129.812 263.867 102.705 261.855L52.481 258.129L90.924 225.592C111.706 208.004 111.671 175.973 90.924 158.414L52.48 125.877L102.706 122.151C129.857 120.137 148.656 94.204 142.193 67.802L130.216 18.883L173.039 45.39C196.227 59.7450000000001 226.661 49.742 236.93 24.6320000000001zM256 64C185.42 64 128 121.421 128 192C128 262.58 185.42 320 256 320C326.579 320 384 262.58 384 192C384 121.421 326.579 64 256 64zM256 272C211.888 272 176 236.112 176 192S211.888 112 256 112S336 147.888 336 192S300.112 272 256 272z" />
<glyph glyph-name="thumbs-down"
unicode="&#xF165;"
horiz-adv-x="512" d=" M466.27 222.69C470.944 245.337 467.134 267.228 457.28 285.68C460.238 309.548 453.259 334.245 439.94 352.67C438.986 408.577 404.117 448 327 448C320 448 312 447.99 304.78 447.99C201.195 447.99 168.997 408 128 408H117.155C111.515 412.975 104.113 416 96 416H32C14.327 416 0 401.673 0 384V144C0 126.327 14.327 112 32 112H96C107.842 112 118.175 118.438 123.708 128H130.76C149.906 111.047 176.773 67.347 199.52 44.6C213.187 30.9330000000001 209.673 -64 271.28 -64C328.86 -64 366.55 -32.064 366.55 40.73C366.55 59.14 362.62 74.46 357.7 87.27H394.18C442.782 87.27 479.9999999999999 128.835 479.9999999999999 172.85C479.9999999999999 192 475.04 207.84 466.2699999999999 222.69zM64 152C50.745 152 40 162.745 40 176S50.745 200 64 200S88 189.255 88 176S77.255 152 64 152zM394.18 135.27H290.19C290.19 97.45 318.55 79.9 318.55 40.73C318.55 16.98 318.55 -16.0000000000001 271.2800000000001 -16.0000000000001C252.3700000000001 2.91 261.8200000000001 50.18 233.4600000000001 78.54C206.9 105.11 167.28 176 138.92 176H128V362.17C181.611 362.17 228.001 399.99 299.64 399.99H337.46C372.972 399.99 398.28 382.87 390.58 334.0900000000001C405.78 325.93 417.08 297.65 404.52 276.52C426.101 256.136 423.219 225.455 409.73 210.9C419.18 210.9 432.09 191.99 432 173.09C431.91 154.18 415.29 135.2700000000001 394.18 135.2700000000001z" />
<glyph glyph-name="thumbs-up"
unicode="&#xF164;"
horiz-adv-x="512" d=" M466.27 161.31C475.04 176.16 480 192 480 211.15C480 255.165 442.782 296.73 394.18 296.73H357.7C362.62 309.54 366.55 324.86 366.55 343.27C366.55 416.064 328.86 448 271.28 448C209.673 448 213.187 353.067 199.52 339.4C176.773 316.653 149.905 272.953 130.76 256H32C14.327 256 0 241.673 0 224V-16C0 -33.673 14.327 -48 32 -48H96C110.893 -48 123.408 -37.826 126.978 -24.05C171.487 -25.051 202.038 -63.99 304.78 -63.99C312 -63.99 320 -64 327 -64C404.117 -64 438.986 -24.577 439.94 31.33C453.259 49.755 460.239 74.452 457.28 98.32C467.134 116.772 470.944 138.663 466.27 161.31zM404.52 107.48C417.08 86.35 405.78 58.0700000000001 390.58 49.91C398.28 1.13 372.972 -15.99 337.46 -15.99H299.64C228.001 -15.99 181.611 21.83 128 21.83V208H138.92C167.28 208 206.9 278.89 233.46 305.46C261.82 333.82 252.37 381.09 271.28 400C318.55 400 318.55 367.02 318.55 343.27C318.55 304.1 290.19 286.55 290.19 248.73H394.18C415.29 248.73 431.91 229.82 432 210.91C432.0899999999999 192.01 419.18 173.1 409.73 173.1C423.219 158.545 426.101 127.864 404.52 107.48zM88 16C88 2.745 77.255 -8 64 -8S40 2.745 40 16S50.745 40 64 40S88 29.255 88 16z" />
<glyph glyph-name="times-circle"
unicode="&#xF057;"
horiz-adv-x="512" d=" M256 440C119 440 8 329 8 192S119 -56 256 -56S504 55 504 192S393 440 256 440zM256 -8C145.5 -8 56 81.5 56 192S145.5 392 256 392S456 302.5 456 192S366.5 -8 256 -8zM357.8 254.2L295.6 192L357.8 129.8C362.5 125.1 362.5 117.5 357.8 112.8L335.2 90.2C330.5 85.5 322.9 85.5 318.2 90.2L256 152.4L193.8 90.2C189.1 85.5 181.5 85.5 176.8 90.2L154.2 112.8C149.5 117.5 149.5 125.1 154.2 129.8L216.4 192L154.2000000000001 254.2C149.5000000000001 258.9 149.5000000000001 266.5 154.2000000000001 271.2L176.8000000000001 293.8C181.5 298.5 189.1000000000001 298.5 193.8000000000001 293.8L256.0000000000001 231.6L318.2000000000001 293.8C322.9000000000001 298.5 330.5000000000001 298.5 335.2000000000001 293.8L357.8000000000001 271.2C362.5000000000001 266.5 362.5000000000001 258.9 357.8000000000001 254.2z" />
<glyph glyph-name="trash-alt"
unicode="&#xF2ED;"
horiz-adv-x="448" d=" M192 260V44C192 37.373 186.627 32 180 32H156C149.373 32 144 37.373 144 44V260C144 266.627 149.373 272 156 272H180C186.627 272 192 266.627 192 260zM292 272H268C261.373 272 256 266.627 256 260V44C256 37.373 261.373 32 268 32H292C298.627 32 304 37.373 304 44V260C304 266.627 298.627 272 292 272zM424 368C437.255 368 448 357.255 448 344V332C448 325.373 442.627 320 436 320H416V-16C416 -42.51 394.51 -64 368 -64H80C53.49 -64 32 -42.51 32 -16V320H12C5.373 320 0 325.373 0 332V344C0 357.255 10.745 368 24 368H98.411L132.429 424.6960000000001A48 48 0 0 0 173.589 448H274.412A48 48 0 0 0 315.572 424.6960000000001L349.589 368H424zM154.389 368H293.612L276.1600000000001 397.087A6 6 0 0 1 271.015 400H176.987A6 6 0 0 1 171.842 397.087L154.389 368zM368 320H80V-10A6 6 0 0 1 86 -16H362A6 6 0 0 1 368 -10V320z" />
<glyph glyph-name="user-circle"
unicode="&#xF2BD;"
horiz-adv-x="496" d=" M248 344C195 344 152 301 152 248S195 152 248 152S344 195 344 248S301 344 248 344zM248 200C221.5 200 200 221.5 200 248S221.5 296 248 296S296 274.5 296 248S274.5 200 248 200zM248 440C111 440 0 329 0 192S111 -56 248 -56S496 55 496 192S385 440 248 440zM248 -8C198.3 -8 152.9 10.3 117.9 40.4C132.8 63.4 158.3 79 187.5 79.9C208.3 73.5 228.1 70.3 248 70.3S287.7 73.4 308.5 79.9C337.7 78.9 363.2 63.4 378.1 40.4C343.1 10.3 297.7000000000001 -8 248.0000000000001 -8zM410.7 76.1C386.3 107.5 348.6 128 305.6 128C295.4000000000001 128 279.6 118.4 248.0000000000001 118.4C216.5 118.4 200.6 128 190.4 128C147.5 128 109.8 107.5 85.3 76.1C61.9 108.8 48 148.8 48 192C48 302.3 137.7 392 248 392S448 302.3 448 192C448 148.8 434.1 108.8 410.7 76.1z" />
<glyph glyph-name="user"
unicode="&#xF007;"
horiz-adv-x="448" d=" M313.6 144C284.9000000000001 144 271.1 128 224 128C176.9 128 163.2000000000001 144 134.4 144C60.2 144 0 83.8 0 9.6V-16C0 -42.5 21.5 -64 48 -64H400C426.5 -64 448 -42.5 448 -16V9.6C448 83.8 387.8 144 313.6 144zM400 -16H48V9.6C48 57.2000000000001 86.8 96 134.4 96C149 96 172.7 80 224 80C275.7 80 298.9 96 313.6 96C361.2000000000001 96 400 57.2 400 9.6V-16zM224 160C303.5 160 368 224.5 368 304S303.5 448 224 448S80 383.5 80 304S144.5 160 224 160zM224 400C276.9 400 320 356.9 320 304S276.9 208 224 208S128 251.1 128 304S171.1 400 224 400z" />
<glyph glyph-name="window-close"
unicode="&#xF410;"
horiz-adv-x="512" d=" M464 416H48C21.5 416 0 394.5 0 368V16C0 -10.5 21.5 -32 48 -32H464C490.5 -32 512 -10.5 512 16V368C512 394.5 490.5 416 464 416zM464 22C464 18.7 461.3 16 458 16H54C50.7 16 48 18.7 48 22V362C48 365.3 50.7 368 54 368H458C461.3 368 464 365.3 464 362V22zM356.5 253.4L295.1 192L356.5 130.6C361.1 126 361.1 118.5 356.5 113.8L334.2 91.5C329.6 86.9 322.1 86.9 317.4 91.5L256 152.9L194.6 91.5C190 86.9 182.5 86.9 177.8 91.5L155.5 113.8C150.9 118.4 150.9 125.9 155.5 130.6L216.9 192L155.5 253.4000000000001C150.9 258 150.9 265.5 155.5 270.2000000000001L177.8 292.5000000000001C182.4 297.1 189.9 297.1 194.6 292.5000000000001L256 231.1000000000001L317.4 292.5000000000001C322 297.1 329.5 297.1 334.2 292.5000000000001L356.5 270.2000000000001C361.2 265.6 361.2 258.1 356.5 253.4000000000001z" />
<glyph glyph-name="window-maximize"
unicode="&#xF2D0;"
horiz-adv-x="512" d=" M464 416H48C21.5 416 0 394.5 0 368V16C0 -10.5 21.5 -32 48 -32H464C490.5 -32 512 -10.5 512 16V368C512 394.5 490.5 416 464 416zM464 22C464 18.7 461.3 16 458 16H54C50.7 16 48 18.7 48 22V256H464V22z" />
<glyph glyph-name="window-minimize"
unicode="&#xF2D1;"
horiz-adv-x="512" d=" M480 -32H32C14.3 -32 0 -17.7 0 0S14.3 32 32 32H480C497.7 32 512 17.7 512 0S497.7 -32 480 -32z" />
<glyph glyph-name="window-restore"
unicode="&#xF2D2;"
horiz-adv-x="512" d=" M464 448H144C117.5 448 96 426.5 96 400V352H48C21.5 352 0 330.5 0 304V-16C0 -42.5 21.5 -64 48 -64H368C394.5 -64 416 -42.5 416 -16V32H464C490.5 32 512 53.5 512 80V400C512 426.5 490.5 448 464 448zM368 -16H48V192H368V-16zM464 80H416V304C416 330.5 394.5 352 368 352H144V400H464V80z" />
</font>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load diff

After

Width:  |  Height:  |  Size: 477 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

56
src/autolink.php Normal file
View file

@ -0,0 +1,56 @@
<?php
/**
* Adapted from https://plugins.trac.wordpress.org/browser/sem-external-links/trunk/sem-autolink-uri.php
* which is MIT/GPL licenced.
* Author: Denis de Bernardy & Mike Koepke
* Author URI: https://www.semiologic.com
*/
class AutoLinkExtension {
public static function auto_link_text(string $string) {
$string = preg_replace_callback(
"/
((?<![\"']) # don't look inside quotes
(\b
( # protocol or www.
[a-z]{3,}:\/\/
|
www\.
)
(?: # domain
[a-zA-Z0-9_\-]+
(?:\.[a-zA-Z0-9_\-]+)*
|
localhost
)
(?: # port
\:[0-9]+
)?
(?: # path
\/[a-z0-9:%_|~.-]*
(?:\/[a-z0-9:%_|~.-]*)*
)?
(?: # attributes
\?[a-z0-9:%_|~.=&#;-]*
)?
(?: # anchor
\#[a-z0-9:%_|~.=&#;-]*
)?
)
(?![\"']))
/ix",
function ($match) {
$url = $match[0];
$href = $url;
if (false === strpos($href, 'http')) {
$href = 'http://' . $href;
}
return '<a href="' . $href . '" rel="noreferrer">' . $url . '</a>';
},
$string
);
return $string;
}
}

View file

@ -1,7 +0,0 @@
<?php
// autoload.php @generated by Composer
require_once __DIR__ . '/composer' . '/autoload_real.php';
return ComposerAutoloaderInit125dddd280a32cf75b181166154246ec::getLoader();

View file

@ -1,26 +0,0 @@
<?php
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInit125dddd280a32cf75b181166154246ec
{
public static $prefixesPsr0 = array (
'P' =>
array (
'PhpImap' =>
array (
0 => __DIR__ . '/..' . '/php-imap/php-imap/src',
),
),
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixesPsr0 = ComposerStaticInit125dddd280a32cf75b181166154246ec::$prefixesPsr0;
}, null, ClassLoader::class);
}
}

View file

@ -1,47 +0,0 @@
[
{
"name": "php-imap/php-imap",
"version": "2.0.3",
"version_normalized": "2.0.3.0",
"source": {
"type": "git",
"url": "https://github.com/barbushin/php-imap.git",
"reference": "cc1a49a3f68090db182183c59ffbc09055d59f5b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/barbushin/php-imap/zipball/cc1a49a3f68090db182183c59ffbc09055d59f5b",
"reference": "cc1a49a3f68090db182183c59ffbc09055d59f5b",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"time": "2015-09-16 07:40:39",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-0": {
"PhpImap": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD 3-Clause"
],
"authors": [
{
"name": "Sergey Barbushin",
"email": "barbushin@gmail.com",
"homepage": "http://linkedin.com/in/barbushin"
}
],
"description": "PHP class to access mailbox by POP3/IMAP/NNTP using IMAP extension",
"homepage": "https://github.com/barbushin/php-imap",
"keywords": [
"imap",
"mail",
"php"
]
}
]

View file

@ -1,22 +0,0 @@
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

View file

@ -1,32 +0,0 @@
ImapMailbox
Copyright (c) 2012 by Barbushin Sergey <barbushin@gmail.com>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* The names of the contributors may not be used to endorse or
promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View file

@ -1,53 +0,0 @@
ImapMailbox is PHP class to access mailbox by POP3/IMAP/NNTP using IMAP extension
### Features
* Connect to mailbox by POP3/IMAP/NNTP (see [imap_open](http://php.net/imap_open))
* Get mailbox status (see [imap_check](http://php.net/imap_check))
* Receive emails (+attachments, +html body images)
* Search emails by custom criteria (see [imap_search](http://php.net/imap_search))
* Change email status (see [imap_setflag_full](http://php.net/imap_setflag_full))
* Delete email
### Installation by Composer
{
"require": {
"php-imap/php-imap": "~2.0"
}
}
Or
$ composer require php-imap/php-imap ~2.0
### Migration from `v1.*` to `v2.*`
Just add following code in the head of your script:
use PhpImap\Mailbox as ImapMailbox;
use PhpImap\IncomingMail;
use PhpImap\IncomingMailAttachment;
### [Usage example](https://github.com/barbushin/php-imap/blob/master/example/index.php)
```php
$mailbox = new PhpImap\Mailbox('{imap.gmail.com:993/imap/ssl}INBOX', 'some@gmail.com', '*********', __DIR__);
$mails = array();
$mailsIds = $mailbox->searchMailBox('ALL');
if(!$mailsIds) {
die('Mailbox is empty');
}
$mailId = reset($mailsIds);
$mail = $mailbox->getMail($mailId);
var_dump($mail);
var_dump($mail->getAttachments());
```
### Recommended
* Google Chrome extension [PHP Console](https://chrome.google.com/webstore/detail/php-console/nfhmhhlpfleoednkpnnnkolmclajemef)
* Google Chrome extension [JavaScript Errors Notifier](https://chrome.google.com/webstore/detail/javascript-errors-notifie/jafmfknfnkoekkdocjiaipcnmkklaajd)

View file

@ -1,28 +0,0 @@
{
"name": "php-imap/php-imap",
"description": "PHP class to access mailbox by POP3/IMAP/NNTP using IMAP extension",
"keywords": [
"PHP",
"IMAP",
"mail"
],
"homepage": "https://github.com/barbushin/php-imap",
"license": "BSD 3-Clause",
"type": "library",
"authors": [
{
"name": "Sergey Barbushin",
"homepage": "http://linkedin.com/in/barbushin",
"email": "barbushin@gmail.com"
}
],
"require": {
"php": ">=5.3.0"
},
"autoload": {
"psr-0": {
"PhpImap": "src/"
}
},
"minimum-stability": "stable"
}

View file

@ -1,611 +0,0 @@
<?php namespace PhpImap;
use stdClass;
/**
* @see https://github.com/barbushin/php-imap
* @author Barbushin Sergey http://linkedin.com/in/barbushin
*/
class Mailbox {
protected $imapPath;
protected $imapLogin;
protected $imapPassword;
protected $imapOptions = 0;
protected $imapRetriesNum = 0;
protected $imapParams = array();
protected $serverEncoding;
protected $attachmentsDir;
public function __construct($imapPath, $login, $password, $attachmentsDir = null, $serverEncoding = 'UTF-8') {
$this->imapPath = $imapPath;
$this->imapLogin = $login;
$this->imapPassword = $password;
$this->serverEncoding = strtoupper($serverEncoding);
if($attachmentsDir) {
if(!is_dir($attachmentsDir)) {
throw new Exception('Directory "' . $attachmentsDir . '" not found');
}
$this->attachmentsDir = rtrim(realpath($attachmentsDir), '\\/');
}
}
/**
* Set custom connection arguments of imap_open method. See http://php.net/imap_open
* @param int $options
* @param int $retriesNum
* @param array $params
*/
public function setConnectionArgs($options = 0, $retriesNum = 0, array $params = null) {
$this->imapOptions = $options;
$this->imapRetriesNum = $retriesNum;
$this->imapParams = $params;
}
/**
* Get IMAP mailbox connection stream
* @param bool $forceConnection Initialize connection if it's not initialized
* @return null|resource
*/
public function getImapStream($forceConnection = true) {
static $imapStream;
if($forceConnection) {
if($imapStream && (!is_resource($imapStream) || !imap_ping($imapStream))) {
$this->disconnect();
$imapStream = null;
}
if(!$imapStream) {
$imapStream = $this->initImapStream();
}
}
return $imapStream;
}
protected function initImapStream() {
$imapStream = @imap_open($this->imapPath, $this->imapLogin, $this->imapPassword, $this->imapOptions, $this->imapRetriesNum, $this->imapParams);
if(!$imapStream) {
throw new Exception('Connection error: ' . imap_last_error());
}
return $imapStream;
}
protected function disconnect() {
$imapStream = $this->getImapStream(false);
if($imapStream && is_resource($imapStream)) {
imap_close($imapStream, CL_EXPUNGE);
}
}
/**
* Get information about the current mailbox.
*
* Returns the information in an object with following properties:
* Date - current system time formatted according to RFC2822
* Driver - protocol used to access this mailbox: POP3, IMAP, NNTP
* Mailbox - the mailbox name
* Nmsgs - number of mails in the mailbox
* Recent - number of recent mails in the mailbox
*
* @return stdClass
*/
public function checkMailbox() {
return imap_check($this->getImapStream());
}
/**
* Creates a new mailbox specified by mailbox.
*
* @return bool
*/
public function createMailbox() {
return imap_createmailbox($this->getImapStream(), imap_utf7_encode($this->imapPath));
}
/**
* Gets status information about the given mailbox.
*
* This function returns an object containing status information.
* The object has the following properties: messages, recent, unseen, uidnext, and uidvalidity.
*
* @return stdClass if the box doesn't exist
*/
public function statusMailbox() {
return imap_status($this->getImapStream(), $this->imapPath, SA_ALL);
}
/**
* Gets listing the folders
*
* This function returns an object containing listing the folders.
* The object has the following properties: messages, recent, unseen, uidnext, and uidvalidity.
*
* @return array listing the folders
*/
public function getListingFolders() {
$folders = imap_list($this->getImapStream(), $this->imapPath, "*");
foreach ($folders as $key => $folder)
{
$folder = str_replace($this->imapPath, "", imap_utf7_decode($folder));
$folders[$key] = $folder;
}
return $folders;
}
/**
* This function performs a search on the mailbox currently opened in the given IMAP stream.
* For example, to match all unanswered mails sent by Mom, you'd use: "UNANSWERED FROM mom".
* Searches appear to be case insensitive. This list of criteria is from a reading of the UW
* c-client source code and may be incomplete or inaccurate (see also RFC2060, section 6.4.4).
*
* @param string $criteria String, delimited by spaces, in which the following keywords are allowed. Any multi-word arguments (e.g. FROM "joey smith") must be quoted. Results will match all criteria entries.
* ALL - return all mails matching the rest of the criteria
* ANSWERED - match mails with the \\ANSWERED flag set
* BCC "string" - match mails with "string" in the Bcc: field
* BEFORE "date" - match mails with Date: before "date"
* BODY "string" - match mails with "string" in the body of the mail
* CC "string" - match mails with "string" in the Cc: field
* DELETED - match deleted mails
* FLAGGED - match mails with the \\FLAGGED (sometimes referred to as Important or Urgent) flag set
* FROM "string" - match mails with "string" in the From: field
* KEYWORD "string" - match mails with "string" as a keyword
* NEW - match new mails
* OLD - match old mails
* ON "date" - match mails with Date: matching "date"
* RECENT - match mails with the \\RECENT flag set
* SEEN - match mails that have been read (the \\SEEN flag is set)
* SINCE "date" - match mails with Date: after "date"
* SUBJECT "string" - match mails with "string" in the Subject:
* TEXT "string" - match mails with text "string"
* TO "string" - match mails with "string" in the To:
* UNANSWERED - match mails that have not been answered
* UNDELETED - match mails that are not deleted
* UNFLAGGED - match mails that are not flagged
* UNKEYWORD "string" - match mails that do not have the keyword "string"
* UNSEEN - match mails which have not been read yet
*
* @return array Mails ids
*/
public function searchMailbox($criteria = 'ALL') {
$mailsIds = imap_search($this->getImapStream(), $criteria, SE_UID, $this->serverEncoding);
return $mailsIds ? $mailsIds : array();
}
/**
* Save mail body.
* @return bool
*/
public function saveMail($mailId, $filename = 'email.eml') {
return imap_savebody($this->getImapStream(), $filename, $mailId, "", FT_UID);
}
/**
* Marks mails listed in mailId for deletion.
* @return bool
*/
public function deleteMail($mailId) {
return imap_delete($this->getImapStream(), $mailId, FT_UID);
}
public function moveMail($mailId, $mailBox) {
return imap_mail_move($this->getImapStream(), $mailId, $mailBox, CP_UID) && $this->expungeDeletedMails();
}
/**
* Deletes all the mails marked for deletion by imap_delete(), imap_mail_move(), or imap_setflag_full().
* @return bool
*/
public function expungeDeletedMails() {
return imap_expunge($this->getImapStream());
}
/**
* Add the flag \Seen to a mail.
* @return bool
*/
public function markMailAsRead($mailId) {
return $this->setFlag(array($mailId), '\\Seen');
}
/**
* Remove the flag \Seen from a mail.
* @return bool
*/
public function markMailAsUnread($mailId) {
return $this->clearFlag(array($mailId), '\\Seen');
}
/**
* Add the flag \Flagged to a mail.
* @return bool
*/
public function markMailAsImportant($mailId) {
return $this->setFlag(array($mailId), '\\Flagged');
}
/**
* Add the flag \Seen to a mails.
* @return bool
*/
public function markMailsAsRead(array $mailId) {
return $this->setFlag($mailId, '\\Seen');
}
/**
* Remove the flag \Seen from some mails.
* @return bool
*/
public function markMailsAsUnread(array $mailId) {
return $this->clearFlag($mailId, '\\Seen');
}
/**
* Add the flag \Flagged to some mails.
* @return bool
*/
public function markMailsAsImportant(array $mailId) {
return $this->setFlag($mailId, '\\Flagged');
}
/**
* Causes a store to add the specified flag to the flags set for the mails in the specified sequence.
*
* @param array $mailsIds
* @param string $flag which you can set are \Seen, \Answered, \Flagged, \Deleted, and \Draft as defined by RFC2060.
* @return bool
*/
public function setFlag(array $mailsIds, $flag) {
return imap_setflag_full($this->getImapStream(), implode(',', $mailsIds), $flag, ST_UID);
}
/**
* Cause a store to delete the specified flag to the flags set for the mails in the specified sequence.
*
* @param array $mailsIds
* @param string $flag which you can set are \Seen, \Answered, \Flagged, \Deleted, and \Draft as defined by RFC2060.
* @return bool
*/
public function clearFlag(array $mailsIds, $flag) {
return imap_clearflag_full($this->getImapStream(), implode(',', $mailsIds), $flag, ST_UID);
}
/**
* Fetch mail headers for listed mails ids
*
* Returns an array of objects describing one mail header each. The object will only define a property if it exists. The possible properties are:
* subject - the mails subject
* from - who sent it
* to - recipient
* date - when was it sent
* message_id - Mail-ID
* references - is a reference to this mail id
* in_reply_to - is a reply to this mail id
* size - size in bytes
* uid - UID the mail has in the mailbox
* msgno - mail sequence number in the mailbox
* recent - this mail is flagged as recent
* flagged - this mail is flagged
* answered - this mail is flagged as answered
* deleted - this mail is flagged for deletion
* seen - this mail is flagged as already read
* draft - this mail is flagged as being a draft
*
* @param array $mailsIds
* @return array
*/
public function getMailsInfo(array $mailsIds) {
$mails = imap_fetch_overview($this->getImapStream(), implode(',', $mailsIds), FT_UID);
if(is_array($mails) && count($mails))
{
foreach($mails as &$mail)
{
if(isset($mail->subject)) {
$mail->subject = $this->decodeMimeStr($mail->subject, $this->serverEncoding);
}
if(isset($mail->from)) {
$mail->from = $this->decodeMimeStr($mail->from, $this->serverEncoding);
}
if(isset($mail->to)) {
$mail->to = $this->decodeMimeStr($mail->to, $this->serverEncoding);
}
}
}
return $mails;
}
/**
* Get information about the current mailbox.
*
* Returns an object with following properties:
* Date - last change (current datetime)
* Driver - driver
* Mailbox - name of the mailbox
* Nmsgs - number of messages
* Recent - number of recent messages
* Unread - number of unread messages
* Deleted - number of deleted messages
* Size - mailbox size
*
* @return object Object with info | FALSE on failure
*/
public function getMailboxInfo() {
return imap_mailboxmsginfo($this->getImapStream());
}
/**
* Gets mails ids sorted by some criteria
*
* Criteria can be one (and only one) of the following constants:
* SORTDATE - mail Date
* SORTARRIVAL - arrival date (default)
* SORTFROM - mailbox in first From address
* SORTSUBJECT - mail subject
* SORTTO - mailbox in first To address
* SORTCC - mailbox in first cc address
* SORTSIZE - size of mail in octets
*
* @param int $criteria
* @param bool $reverse
* @return array Mails ids
*/
public function sortMails($criteria = SORTARRIVAL, $reverse = true) {
return imap_sort($this->getImapStream(), $criteria, $reverse, SE_UID);
}
/**
* Get mails count in mail box
* @return int
*/
public function countMails() {
return imap_num_msg($this->getImapStream());
}
/**
* Retrieve the quota settings per user
* @return array - FALSE in the case of call failure
*/
protected function getQuota() {
return imap_get_quotaroot($this->getImapStream(), 'INBOX');
}
/**
* Return quota limit in KB
* @return int - FALSE in the case of call failure
*/
public function getQuotaLimit() {
$quota = $this->getQuota();
if(is_array($quota)) {
$quota = $quota['STORAGE']['limit'];
}
return $quota;
}
/**
* Return quota usage in KB
* @return int - FALSE in the case of call failure
*/
public function getQuotaUsage() {
$quota = $this->getQuota();
if(is_array($quota)) {
$quota = $quota['STORAGE']['usage'];
}
return $quota;
}
/**
* Get mail data
*
* @param $mailId
* @param bool $markAsSeen
* @return IncomingMail
*/
public function getMail($mailId, $markAsSeen = true) {
$head = imap_rfc822_parse_headers(imap_fetchheader($this->getImapStream(), $mailId, FT_UID));
$mail = new IncomingMail();
$mail->id = $mailId;
$mail->date = date('Y-m-d H:i:s', isset($head->date) ? strtotime(preg_replace('/\(.*?\)/', '', $head->date)) : time());
$mail->subject = isset($head->subject) ? $this->decodeMimeStr($head->subject, $this->serverEncoding) : null;
$mail->fromName = isset($head->from[0]->personal) ? $this->decodeMimeStr($head->from[0]->personal, $this->serverEncoding) : null;
$mail->fromAddress = strtolower($head->from[0]->mailbox . '@' . $head->from[0]->host);
if(isset($head->to)) {
$toStrings = array();
foreach($head->to as $to) {
if(!empty($to->mailbox) && !empty($to->host)) {
$toEmail = strtolower($to->mailbox . '@' . $to->host);
$toName = isset($to->personal) ? $this->decodeMimeStr($to->personal, $this->serverEncoding) : null;
$toStrings[] = $toName ? "$toName <$toEmail>" : $toEmail;
$mail->to[$toEmail] = $toName;
}
}
$mail->toString = implode(', ', $toStrings);
}
if(isset($head->cc)) {
foreach($head->cc as $cc) {
$mail->cc[strtolower($cc->mailbox . '@' . $cc->host)] = isset($cc->personal) ? $this->decodeMimeStr($cc->personal, $this->serverEncoding) : null;
}
}
if(isset($head->reply_to)) {
foreach($head->reply_to as $replyTo) {
$mail->replyTo[strtolower($replyTo->mailbox . '@' . $replyTo->host)] = isset($replyTo->personal) ? $this->decodeMimeStr($replyTo->personal, $this->serverEncoding) : null;
}
}
if(isset($head->message_id)) {
$mail->messageId = $head->message_id;
}
$mailStructure = imap_fetchstructure($this->getImapStream(), $mailId, FT_UID);
if(empty($mailStructure->parts)) {
$this->initMailPart($mail, $mailStructure, 0, $markAsSeen);
}
else {
foreach($mailStructure->parts as $partNum => $partStructure) {
$this->initMailPart($mail, $partStructure, $partNum + 1, $markAsSeen);
}
}
return $mail;
}
protected function initMailPart(IncomingMail $mail, $partStructure, $partNum, $markAsSeen = true) {
$options = FT_UID;
if(!$markAsSeen) {
$options |= FT_PEEK;
}
$data = $partNum ? imap_fetchbody($this->getImapStream(), $mail->id, $partNum, $options) : imap_body($this->getImapStream(), $mail->id, $options);
if($partStructure->encoding == 1) {
$data = imap_utf8($data);
}
elseif($partStructure->encoding == 2) {
$data = imap_binary($data);
}
elseif($partStructure->encoding == 3) {
$data = preg_replace('~[^a-zA-Z0-9+=/]+~s', '', $data); // https://github.com/barbushin/php-imap/issues/88
$data = imap_base64($data);
}
elseif($partStructure->encoding == 4) {
$data = quoted_printable_decode($data);
}
$params = array();
if(!empty($partStructure->parameters)) {
foreach($partStructure->parameters as $param) {
$params[strtolower($param->attribute)] = $param->value;
}
}
if(!empty($partStructure->dparameters)) {
foreach($partStructure->dparameters as $param) {
$paramName = strtolower(preg_match('~^(.*?)\*~', $param->attribute, $matches) ? $matches[1] : $param->attribute);
if(isset($params[$paramName])) {
$params[$paramName] .= $param->value;
}
else {
$params[$paramName] = $param->value;
}
}
}
// attachments
$attachmentId = $partStructure->ifid
? trim($partStructure->id, " <>")
: (isset($params['filename']) || isset($params['name']) ? mt_rand() . mt_rand() : null);
if($attachmentId) {
if(empty($params['filename']) && empty($params['name'])) {
$fileName = $attachmentId . '.' . strtolower($partStructure->subtype);
}
else {
$fileName = !empty($params['filename']) ? $params['filename'] : $params['name'];
$fileName = $this->decodeMimeStr($fileName, $this->serverEncoding);
$fileName = $this->decodeRFC2231($fileName, $this->serverEncoding);
}
$attachment = new IncomingMailAttachment();
$attachment->id = $attachmentId;
$attachment->name = $fileName;
if($this->attachmentsDir) {
$replace = array(
'/\s/' => '_',
'/[^0-9a-zаіїє_\.]/iu' => '',
'/_+/' => '_',
'/(^_)|(_$)/' => '',
);
$fileSysName = preg_replace('~[\\\\/]~', '', $mail->id . '_' . $attachmentId . '_' . preg_replace(array_keys($replace), $replace, $fileName));
$attachment->filePath = $this->attachmentsDir . DIRECTORY_SEPARATOR . $fileSysName;
file_put_contents($attachment->filePath, $data);
}
$mail->addAttachment($attachment);
}
else {
if(!empty($params['charset'])) {
$data = $this->convertStringEncoding($data, $params['charset'], $this->serverEncoding);
}
if($partStructure->type == 0 && $data) {
if(strtolower($partStructure->subtype) == 'plain') {
$mail->textPlain .= $data;
}
else {
$mail->textHtml .= $data;
}
}
elseif($partStructure->type == 2 && $data) {
$mail->textPlain .= trim($data);
}
}
if(!empty($partStructure->parts)) {
foreach($partStructure->parts as $subPartNum => $subPartStructure) {
if($partStructure->type == 2 && $partStructure->subtype == 'RFC822') {
$this->initMailPart($mail, $subPartStructure, $partNum, $markAsSeen);
}
else {
$this->initMailPart($mail, $subPartStructure, $partNum . '.' . ($subPartNum + 1), $markAsSeen);
}
}
}
}
protected function decodeMimeStr($string, $charset = 'utf-8') {
$newString = '';
$elements = imap_mime_header_decode($string);
for($i = 0; $i < count($elements); $i++) {
if($elements[$i]->charset == 'default') {
$elements[$i]->charset = 'iso-8859-1';
}
$newString .= $this->convertStringEncoding($elements[$i]->text, $elements[$i]->charset, $charset);
}
return $newString;
}
function isUrlEncoded($string) {
$hasInvalidChars = preg_match( '#[^%a-zA-Z0-9\-_\.\+]#', $string );
$hasEscapedChars = preg_match( '#%[a-zA-Z0-9]{2}#', $string );
return !$hasInvalidChars && $hasEscapedChars;
}
protected function decodeRFC2231($string, $charset = 'utf-8') {
if(preg_match("/^(.*?)'.*?'(.*?)$/", $string, $matches)) {
$encoding = $matches[1];
$data = $matches[2];
if($this->isUrlEncoded($data)) {
$string = $this->convertStringEncoding(urldecode($data), $encoding, $charset);
}
}
return $string;
}
/**
* Converts a string from one encoding to another.
* @param string $string
* @param string $fromEncoding
* @param string $toEncoding
* @return string Converted string if conversion was successful, or the original string if not
*/
protected function convertStringEncoding($string, $fromEncoding, $toEncoding) {
$convertedString = null;
if($string && $fromEncoding != $toEncoding) {
$convertedString = @iconv($fromEncoding, $toEncoding . '//IGNORE', $string);
if(!$convertedString && extension_loaded('mbstring')) {
$convertedString = @mb_convert_encoding($string, $toEncoding, $fromEncoding);
}
}
return $convertedString ?: $string;
}
public function __destruct() {
$this->disconnect();
}
}
class Exception extends \Exception {
}

View file

@ -1,168 +0,0 @@
<?php
# set the new path of config.php (must be in a safe location outside the `public_html`)
require_once '../../config.php';
# load php dependencies:
require_once './backend-libs/autoload.php';
$mailbox = new PhpImap\Mailbox($config['imap']['url'],
$config['imap']['username'],
$config['imap']['password']);
/**
* print error and stop program.
* @param $status integer http status
* @param $text string error text
*/
function error($status, $text) {
@http_response_code($status);
@print("{\"error\": \"$text\"}");
die();
}
/**
* print all mails for the given $user.
* @param $username string username
* @param $address string email address
*/
function print_emails($username, $address) {
global $mailbox;
// Search for mails with the recipient $address in TO or CC.
$mailsIdsTo = imap_sort($mailbox->getImapStream(), SORTARRIVAL, true, SE_UID, 'TO "' . $address . '"');
$mailsIdsCc = imap_sort($mailbox->getImapStream(), SORTARRIVAL, true, SE_UID, 'CC "' . $address . '"');
$mail_ids = array_merge($mailsIdsTo, $mailsIdsCc);
$emails = _load_emails($mail_ids, $address);
header('Content-type: application/json');
print(json_encode(array("mails" => $emails, 'username' => $username, 'address' => $address)));
}
/**
* deletes emails by id and username. The $address must match the recipient in the email.
*
* @param $mailid integer imap email id
* @param $address string email address
* @internal param the $username matching username
*/
function delete_email($mailid, $address) {
global $mailbox;
if (_load_one_email($mailid, $address) !== null) {
$mailbox->deleteMail($mailid);
$mailbox->expungeDeletedMails();
header('Content-type: application/json');
print(json_encode(array("success" => true)));
} else {
error(404, 'delete error: invalid username/mailid combination');
}
}
/**
* download email by id and username. The $address must match the recipient in the email.
*
* @param $mailid integer imap email id
* @param $address string email address
* @internal param the $username matching username
*/
function download_email($mailid, $address) {
global $mailbox;
if (_load_one_email($mailid, $address) !== null) {
header("Content-Type: message/rfc822; charset=utf-8");
header("Content-Disposition: attachment; filename=\"$address-$mailid.eml\"");
$headers = imap_fetchheader($mailbox->getImapStream(), $mailid, FT_UID);
$body = imap_body($mailbox->getImapStream(), $mailid, FT_UID);
print ($headers . "\n" . $body);
} else {
error(404, 'download error: invalid username/mailid combination');
}
}
/**
* Load exactly one email, the $address in TO or CC has to match.
* @param $mailid integer
* @param $address String address
* @return email or null
*/
function _load_one_email($mailid, $address) {
// in order to avoid https://www.owasp.org/index.php/Top_10_2013-A4-Insecure_Direct_Object_References
// the recipient in the email has to match the $address.
$emails = _load_emails(array($mailid), $address);
return count($emails) === 1 ? $emails[0] : null;
}
/**
* Load emails using the $mail_ids, the mails have to match the $address in TO or CC.
* @param $mail_ids array of integer ids
* @param $address String address
* @return array of emails
*/
function _load_emails($mail_ids, $address) {
global $mailbox;
$emails = array();
foreach ($mail_ids as $id) {
$mail = $mailbox->getMail($id);
// imap_search also returns partials matches. The mails have to be filtered again:
if (array_key_exists($address, $mail->to) || array_key_exists($address, $mail->cc)) {
$emails[] = $mail;
}
}
return $emails;
}
/**
* Remove illegal characters from username and remove everything after the @-sign. You may extend it if your server supports them.
* @param $username
* @return string clean username
*/
function _clean_username($username) {
$username = strtolower($username);
$username = preg_replace('/@.*$/', "", $username); // remove part after @
return preg_replace('/[^A-Za-z0-9_.+-]/', "", $username); // remove special characters
}
/**
* deletes messages older than X days.
*/
function delete_old_messages() {
global $mailbox, $config;
$ids = $mailbox->searchMailbox('BEFORE ' . date('d-M-Y', strtotime($config['delete_messages_older_than'])));
foreach ($ids as $id) {
$mailbox->deleteMail($id);
}
$mailbox->expungeDeletedMails();
}
// Never cache requests:
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
if (isset($_GET['username'])) {
// perform common validation:
$username = _clean_username($_GET['username']);
if (strlen($username) === 0) {
error(400, 'invalid username');
}
$address = $username . "@" . $config['mailHostname'];
// simple router:
if (isset($_GET['download_email_id'])) {
download_email($_GET['download_email_id'], $address);
} else if (isset($_GET['delete_email_id'])) {
delete_email($_GET['delete_email_id'], $address);
} else {
print_emails($username, $address);
}
} else {
error(400, 'invalid action');
}
// run on every request
delete_old_messages();

View file

@ -1,12 +0,0 @@
[ec-stickyfill] {
position: -webkit-sticky;
position: sticky;
top: 0px;
}
[ec-stickyfill]:before,
[ec-stickyfill]:after {
content: '';
display: table;
}

View file

@ -1,8 +0,0 @@
/**
* An Angular directive for stickyfill (position sticky polyfill)
*
* @version v0.1.0 - 2016-08-31
* @author Corey Wilson <corey@eastcodes.com>
* @license Unlicense, http://unlicense.org/
*/
!function(e,i){"use strict";if("function"==typeof define&&define.amd)define(["angular","stickyfill"],i);else{if("undefined"==typeof module||"object"!=typeof module.exports)return i(e.angular,e.Stickyfill);module.exports=i(require("angular"),require("stickyfill"))}}(window,function(e,i){"use strict";function t(){function e(e,t,n){if("object"!=typeof i)throw new Error("stickyfill.js not loaded");i.add(t[0]),e.$on("$destroy",function(){i.remove(t[0])})}var t={link:e,restrict:"A"};return t}if("function"==typeof i)var i=i();var n="ec.stickyfill";return e.module(n,[]).directive("ecStickyfill",t),n});

View file

@ -1,137 +0,0 @@
// config:
var reload_interval_ms = 10000;
var backend_url = './backend.php';
function generateRandomUsername() {
var username = "";
if (chance.bool()) {
username += chance.first();
if (chance.bool()) {
username += chance.last();
}
} else {
username += chance.word({syllables: 3})
}
if (chance.bool()) {
username += chance.integer({min: 30, max: 99});
}
return username.toLowerCase();
}
var app = angular.module('app', ["ngSanitize"]);
// http://stackoverflow.com/a/20033625/79461
app.filter("nl2br", function () {
return function (data) {
if (!data) return data;
return data.replace(/\r?\n/g, '<br/>');
}
}
);
// http://stackoverflow.com/a/20033625/79461
app.filter("autolink", function () {
return function (data) {
return Autolinker.link(data, {truncate: {length: 50, location: 'middle', newWindow: true}});
}
});
app.controller('MailboxController', ["$interval", "$http", "$log", function ($interval, $http, $log) {
var self = this;
self.backend_url = backend_url;
self.updateUsername = function (username) {
username = username.replace(/[@].*$/, ''); // remove part after "@"
if (self.username !== username) {
// changed
self.username = username;
hasher.setHash(self.username);
if (self.username.length > 0) {
self.address = self.username; // use username until real address has been loaded
self.updateMails();
} else {
self.randomize();
}
}
self.inputFieldUsername = self.username;
};
self.randomize = function () {
self.updateUsername(generateRandomUsername());
};
self.onHashChange = function (hash) {
self.updateUsername(hash);
};
self.$onInit = function () {
hasher.changed.add(self.onHashChange.bind(self));
hasher.initialized.add(self.onHashChange.bind(self)); //add initialized listener (to grab initial value in case it is already set)
hasher.init(); //initialize hasher (start listening for history changes)
$interval(self.updateMails, reload_interval_ms);
};
self.updateMails = function () {
if (self.username) {
self.loadEmailsAsync(self.username);
}
};
self.loadEmailsAsync = function (username) {
$http.get(backend_url, {params: {username: username}})
.then(function successCallback(response) {
if (response.data.mails) {
self.error = null;
self.mails = response.data.mails;
self.address = response.data.address;
self.username = response.data.username;
if (self.inputFieldUsername === self.username) {
self.inputFieldUsername = self.address;
}
} else {
self.error = {
title: "JSON_ERROR",
desc: "The JSON from the response can not be read.",
detail: response
};
$log.error(response);
}
}, function errorCallback(response) {
$log.error(response, this);
self.error = {
title: "HTTP_ERROR",
desc: "There is a problem with loading the data. (HTTP_ERROR).",
detail: response
};
});
};
self.deleteMail = function (mail, index) {
// instantly remove from frontend.
self.mails.splice(index, 1);
// remove on backend.
var firstTo = Object.keys(mail.to)[0];
$http.get(backend_url, {params: {username: firstTo, delete_email_id: mail.id}})
.then(
function successCallback(response) {
self.updateMails();
},
function errorCallback(response) {
$log.error(response, this);
self.error = {
title: "HTTP_ERROR",
desc: "There is a problem with deleting the mail. (HTTP_ERROR).",
detail: response
};
});
};
// Initial load
self.updateMails()
}]);

View file

@ -1,59 +0,0 @@
html > body {
/* override bootstrap background */
background: #f9f9f9;
}
footer p {
margin-top: 50px;
text-align: center;
}
.email-table {
margin-top: 20px;
}
div.min-height {
min-height: 400px;
}
header {
background-color: #D9E2E9;
/* leave some space on top */
padding-top: 5px;
}
#openRandomButton {
/* center vertically */
margin-top: 6px;
}
.email-table > .email {
border-top: 5px solid #7C96AB;
/* idea: card shadow arround:
see https://blog.alexdevero.com/mastering-card-design-with-bootstrap-4/
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
*/
}
.header-shadow {
box-shadow: 0 2px 2px rgba(182, 182, 182, 0.75);
}
.sticky-header {
top: 0;
z-index: 1000;
background-color: white;
}
.waiting-screen {
padding: 40px 15px;
text-align: center;
}
div.min-height {
min-height: 400px;
}

View file

@ -3,22 +3,37 @@
// set your time zone:
date_default_timezone_set('Europe/Paris');
// enable while testing:
error_reporting(E_ALL);
// enable in production:
// error_reporting(0);
// set locale (see supported locales: https://github.com/fightbulc/moment.php#switch-locale)
$config['locale'] = 'en_US';
// enable in production:
error_reporting(0);
// enable while testing:
//ini_set('display_errors', 1);
//ini_set('display_startup_errors', 1);
//error_reporting(E_ALL);
// configure this option if you want to allow requests from clients from other domains:
// see https://en.wikipedia.org/wiki/Cross-origin_resource_sharing
// header("Access-Control-Allow-Origin: *");
// Change IMAP settings (check SSL flags on http://php.net/manual/en/function.imap-open.php)
$config['imap']['url'] = '{example.com/imap/ssl}INBOX';
$config['imap']['username'] = "test";
$config['imap']['password'] = "test";
$config['imap']['url'] = '{imap.example.com:993/imap/ssl}INBOX';
$config['imap']['username'] = "myuser";
$config['imap']['password'] = "mypassword";
// email domain, usually different from imap hostname:
$config['mailHostname'] = "example.com";
// For gmail you can use '{imap.gmail.com:993/imap/ssl}INBOX'
// and follow the troubleshooting at:
// https://stackoverflow.com/a/25238515/79461
// email domains, usually different from imap hostname:
$config['domains'] = array('mydomain.com', 'example.com');
// When to delete old messages?
$config['delete_messages_older_than'] = '30 days ago';
$config['delete_messages_older_than'] = '30 days ago';
// Mails to those usernames can not be accessed:
$config['blocked_usernames'] = array('root', 'admin', 'administrator', 'hostmaster', 'postmaster', 'webmaster');
// Mails are usually show as Text and only if not available as HTML. You can turn this around to prefer HTML over text.
$config['prefer_plaintext'] = true;

38
src/config_helper.php Normal file
View file

@ -0,0 +1,38 @@
<?php
/**
* searches for a config-file in the current and parent directories until found.
* @return path to found config file, or FALSE otherwise.
*/
function find_config($filename='config.php') {
// Count the deph of the current directory, so we know how far we can go up.
$path_length = substr_count(getcwd(), DIRECTORY_SEPARATOR)
+ 1; // also search the current directory
$dir = '.'; // updated in each loop
for ($i=0; $i<$path_length;$i++) {
$config_filename = $dir . DIRECTORY_SEPARATOR . $filename;
if (file_exists($config_filename)) {
return $config_filename;
} else {
$dir = '../' . $dir;
}
}
return false;
}
/**
* searches and loads the config file. Prints an error if not found.
*/
function load_config() {
global $config;
$file = find_config();
if ($file !== false) {
require_once($file);
if (!isset($config) || !is_array($config)) {
die('ERROR: Config file is invalid. Please see the installation instructions in the README.md');
}
} else {
die('ERROR: Config file not found. Please see the installation instructions in the README.md');
}
}

156
src/controller.php Normal file
View file

@ -0,0 +1,156 @@
<?php
require_once './imap_client.php';
function render_error($status, $msg) {
@http_response_code($status);
die("{'result': 'error', 'error': '$msg'}");
}
class DisplayEmailsController {
public static function matches() {
return !isset($_GET['action']) && !empty($_SERVER['QUERY_STRING'] ?? '');
}
public static function invoke(ImapClient $imapClient, array $config) {
$address = $_SERVER['QUERY_STRING'] ?? '';
$user = User::parseDomain($address, $config['blocked_usernames']);
if ($user->isInvalid($config['domains'])) {
RedirectToRandomAddressController::invoke($imapClient, $config);
return;
}
$emails = $imapClient->get_emails($user);
DisplayEmailsController::render($emails, $config, $user);
}
public static function render($emails, $config, $user) {
// variables that have to be defined here for frontend template: $emails, $config
require "frontend.template.php";
}
}
class RedirectToAddressController {
public static function matches() {
return ($_GET['action'] ?? null) === "redirect"
&& isset($_POST['username'])
&& isset($_POST['domain']);
}
public static function invoke(ImapClient $imapClient, array $config) {
$user = User::parseUsernameAndDomain($_POST['username'], $_POST['domain'], $config['blocked_usernames']);
RedirectToAddressController::render($user->username . "@" . $user->domain);
}
public static function render($address) {
header("location: ?$address");
}
}
class RedirectToRandomAddressController {
public static function matches() {
return ($_GET['action'] ?? null) === 'random';
}
public static function invoke(ImapClient $imapClient, array $config) {
$address = User::get_random_address($config{'domains'});
RedirectToAddressController::render($address);
}
}
class HasNewMessagesControllerJson {
public static function matches() {
return ($_GET['action'] ?? null) === "has_new_messages"
&& isset($_GET['email_ids'])
&& isset($_GET['address']);
}
public static function invoke(ImapClient $imapClient, array $config) {
$email_ids = $_GET['email_ids'];
$address = $_GET['address'];
$user = User::parseDomain($address, $config['blocked_usernames']);
if ($user->isInvalid($config['domains'])) {
render_error(400, "invalid email address");
}
$emails = $imapClient->get_emails($user);
$knownMailIds = explode('|', $email_ids);
$newMailIds = array_map(function ($mail) {
return $mail->id;
}, $emails);
$onlyNewMailIds = array_diff($newMailIds, $knownMailIds);
HasNewMessagesControllerJson::render(count($onlyNewMailIds));
}
public static function render($counter) {
header('Content-Type: application/json');
print json_encode($counter);
}
}
class DownloadEmailController {
public static function matches() {
return ($_GET['action'] ?? null) === "download_email"
&& isset($_GET['email_id'])
&& isset($_GET['address']);
}
public static function invoke(ImapClient $imapClient, array $config) {
$email_id = $_GET['email_id'];
$address = $_GET['address'];
$user = User::parseDomain($address, $config['blocked_usernames']);
if ($user->isInvalid($config['domains'])) {
RedirectToRandomAddressController::invoke($imapClient, $config);
return;
}
$download_email_id = filter_var($email_id, FILTER_SANITIZE_NUMBER_INT);
$full_email = $imapClient->load_one_email_fully($download_email_id, $user);
if ($full_email !== null) {
$filename = $user->address . "-" . $download_email_id . ".eml";
DownloadEmailController::renderDownloadEmailAsRfc822($full_email, $filename);
} else {
render_error(404, 'download error: invalid username/mailid combination');
}
}
public static function renderDownloadEmailAsRfc822($full_email, $filename) {
header("Content-Type: message/rfc822; charset=utf-8");
header("Content-Disposition: attachment; filename=\"$filename\"");
print $full_email;
}
}
class DeleteEmailController {
public static function matches() {
return ($_GET['action'] ?? null) === "delete_email"
&& isset($_GET['email_id'])
&& isset($_GET['address']);
}
public static function invoke(ImapClient $imapClient, array $config) {
$email_id = $_GET['email_id'];
$address = $_GET['address'];
$user = User::parseDomain($address, $config['blocked_usernames']);
if ($user->isInvalid($config['domains'])) {
RedirectToRandomAddressController::invoke($imapClient, $config);
return;
}
$delete_email_id = filter_var($email_id, FILTER_SANITIZE_NUMBER_INT);
if ($imapClient->delete_email($delete_email_id, $user)) {
RedirectToAddressController::render($address);
} else {
render_error(404, 'delete error: invalid username/mailid combination');
}
}
}

366
src/frontend.template.php Normal file
View file

@ -0,0 +1,366 @@
<?php
/*
input:
User $user - User object
array $config - config array
array $emails - array of emails
*/
require_once './autolink.php';
// Load HTML Purifier
$purifier_config = HTMLPurifier_Config::createDefault();
$purifier_config->set('HTML.Nofollow', true);
$purifier_config->set('HTML.ForbiddenElements', array("img"));
$purifier = new HTMLPurifier($purifier_config);
\Moment\Moment::setLocale($config['locale']);
$mailIds = array_map(function ($mail) {
return $mail->id;
}, $emails);
$mailIdsJoinedString = filter_var(join('|', $mailIds), FILTER_SANITIZE_SPECIAL_CHARS);
// define bigger renderings here to keep the php sections within the html short.
function niceDate($date) {
$m = new \Moment\Moment($date, date_default_timezone_get());
return $m->calendar();
}
function printMessageBody($email, $purifier) {
global $config;
// To avoid showing empty mails, first purify the html and plaintext
// before checking if they are empty.
$safeHtml = $purifier->purify($email->textHtml);
$safeText = htmlspecialchars($email->textPlain);
$safeText = nl2br($safeText);
$safeText = \AutoLinkExtension::auto_link_text($safeText);
$hasHtml = strlen(trim($safeHtml)) > 0;
$hasText = strlen(trim($safeText)) > 0;
if ($config['prefer_plaintext']) {
if ($hasText) {
echo $safeText;
} else {
echo $safeHtml;
}
} else {
if ($hasHtml) {
echo $safeHtml;
} else {
echo $safeText;
}
}
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="assets/bootstrap/4.1.1/bootstrap.min.css"
integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB"
crossorigin="anonymous">
<link rel="stylesheet" href="assets/fontawesome/v5.0.13/all.css"
integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp"
crossorigin="anonymous">
<title><?php
echo $emails ? "(" . count($emails) . ") " : "";
echo $user->address ?></title>
<link rel="stylesheet" href="assets/spinner.css">
<link rel="stylesheet" href="assets/custom.css">
<script>
var mailCount = <?php echo count($emails)?>;
setInterval(function () {
var r = new XMLHttpRequest();
r.open("GET", "?action=has_new_messages&address=<?php echo $user->address?>&email_ids=<?php echo $mailIdsJoinedString?>", true);
r.onreadystatechange = function () {
if (r.readyState != 4 || r.status != 200) return;
if (r.responseText > 0) {
console.log("There are", r.responseText, "new mails.");
document.getElementById("new-content-avalable").style.display = 'block';
// If there are no emails displayed, we can reload the page without losing any state.
if (mailCount === 0) {
location.reload();
}
}
};
r.send();
}, 15000);
</script>
</head>
<body>
<div id="new-content-avalable">
<div class="alert alert-info alert-fixed" role="alert">
<strong>New emails</strong> have arrived.
<button type="button" class="btn btn-outline-secondary" onclick="location.reload()">
<i class="fas fa-sync"></i>
Reload!
</button>
</div>
<!-- move the rest of the page a bit down to show all content -->
<div style="height: 3rem">&nbsp;</div>
</div>
<header>
<div class="container">
<p class="lead ">
Your disposable mailbox is ready.
</p>
<div class="row" id="address-box-normal">
<div class="col my-address-block">
<span id="my-address"><?php echo $user->address ?></span>&nbsp;<button class="copy-button" data-clipboard-target="#my-address">Copy</button>
</div>
<div class="col get-new-address-col">
<button type="button" class="btn btn-outline-dark"
data-toggle="collapse" title="choose your own address"
data-target=".change-address-toggle"
aria-controls="address-box-normal address-box-edit" aria-expanded="false">
<i class="fas fa-magic"></i> Change address
</button>
</div>
</div>
<form class="collapse change-address-toggle" id="address-box-edit" action="?action=redirect" method="post">
<div class="card">
<div class="card-body">
<p>
<a href="?action=random" role="button" class="btn btn-dark">
<i class="fa fa-random"></i>
Open random mailbox
</a>
</p>
or create your own address:
<div class="form-row align-items-center">
<div class="col-sm">
<label class="sr-only" for="inlineFormInputName">username</label>
<input name="username" type="text" class="form-control" id="inlineFormInputName"
placeholder="username"
value="<?php echo $user->username ?>">
</div>
<div class="col-sm-auto my-1">
<label class="sr-only" for="inlineFormInputGroupUsername">Domain</label>
<div class="input-group">
<div class="input-group-prepend">
<div class="input-group-text">@</div>
</div>
<select class="custom-select" id="inlineFormInputGroupUsername" name="domain">
<?php
foreach ($config['domains'] as $aDomain) {
$selected = $aDomain === $user->domain ? ' selected ' : '';
print "<option value='$aDomain' $selected>$aDomain</option>";
}
?>
</select>
</div>
</div>
<div class="col-auto my-1">
<button type="submit" class="btn btn-primary">Open mailbox</button>
</div>
</div>
</div>
</div>
</form>
</div>
</header>
<main>
<div class="container">
<div id="email-list" class="list-group">
<?php
foreach ($emails as $email) {
$safe_email_id = filter_var($email->id, FILTER_VALIDATE_INT); ?>
<a class="list-group-item list-group-item-action email-list-item" data-toggle="collapse"
href="#mail-box-<?php echo $email->id ?>"
role="button"
aria-expanded="false" aria-controls="mail-box-<?php echo $email->id ?>">
<div class="media">
<button class="btn btn-white open-collapse-button">
<i class="fas fa-caret-right expand-button-closed"></i>
<i class="fas fa-caret-down expand-button-opened"></i>
</button>
<div class="media-body">
<h6 class="list-group-item-heading"><?php echo filter_var($email->fromName, FILTER_SANITIZE_SPECIAL_CHARS) ?>
<span class="text-muted"><?php echo filter_var($email->fromAddress, FILTER_SANITIZE_SPECIAL_CHARS) ?></span>
<small class="float-right"
title="<?php echo $email->date ?>"><?php echo niceDate($email->date) ?></small>
</h6>
<p class="list-group-item-text text-truncate" style="width: 75%">
<?php echo filter_var($email->subject, FILTER_SANITIZE_SPECIAL_CHARS); ?>
</p>
</div>
</div>
</a>
<div id="mail-box-<?php echo $email->id ?>" role="tabpanel" aria-labelledby="headingCollapse1"
class="card-collapse collapse"
aria-expanded="true">
<div class="card-body">
<div class="card-block email-body">
<div class="float-right primary">
<a class="btn btn-outline-primary btn-sm" download="true"
role="button"
href="<?php echo "?action=download_email&email_id=$safe_email_id&address=$user->address" ?>">
Download
</a>
<a class="btn btn-outline-danger btn-sm"
role="button"
href="<?php echo "?action=delete_email&email_id=$safe_email_id&address=$user->address" ?>">
Delete
</a>
</div>
<?php printMessageBody($email, $purifier); ?>
</div>
</div>
</div>
<?php
} ?>
<?php
if (empty($emails)) {
?>
<div id="empty-mailbox">
<p>The mailbox is empty. Checking for new emails automatically. </p>
<div class="spinner">
<div class="rect1"></div>
<div class="rect2"></div>
<div class="rect3"></div>
<div class="rect4"></div>
<div class="rect5"></div>
</div>
</div>
<?php
} ?>
</div>
</div>
</main>
<footer>
<div class="container">
<!-- <select id="language-selection" class="custom-select" title="Language">-->
<!-- <option selected>English</option>-->
<!-- <option value="1">Deutsch</option>-->
<!-- <option value="2">Two</option>-->
<!-- <option value="3">Three</option>-->
<!-- </select>-->
<!-- <br>-->
<small class="text-justify quick-summary">
This is a disposable mailbox service. Whoever knows your username, can read your emails.
Emails will be deleted after 30 days.
<a data-toggle="collapse" href="#about"
aria-expanded="false"
aria-controls="about">
Show Details
</a>
</small>
<div class="card card-body collapse" id="about" style="max-width: 40rem">
<p class="text-justify">This disposable mailbox keeps your main mailbox clean from spam.</p>
<p class="text-justify">Just choose an address and use it on websites you don't trust and
don't
want to use
your
main email address.
Once you are done, you can just forget about the mailbox. All the spam stays here and does
not
fill up
your
main mailbox.
</p>
<p class="text-justify">
You select the address you want to use and received emails will be displayed
automatically.
There is no registration and no passwords. If you know the address, you can read the
emails.
<strong>Basically, all emails are public. So don't use it for sensitive data.</strong>
</p>
</div>
<p>
<small>Powered by
<a
href="https://github.com/synox/disposable-mailbox"><strong>synox/disposable-mailbox</strong></a>
</small>
</p>
</div>
</footer>
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="assets/jquery/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"></script>
<script src="assets/popper.js/1.14.3/umd/popper.min.js"
integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
crossorigin="anonymous"></script>
<script src="assets/bootstrap/4.1.1/bootstrap.min.js"
integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T"
crossorigin="anonymous"></script>
<script src="assets/clipboard.js/clipboard.min.js"
integrity="sha384-8CYhPwYlLELodlcQV713V9ZikA3DlCVaXFDpjHfP8Z36gpddf/Vrt47XmKDsCttu"
crossorigin="anonymous"></script>
<script>
clipboard = new ClipboardJS('[data-clipboard-target]');
$(function () {
$('[data-tooltip="tooltip"]').tooltip()
});
/** from https://github.com/twbs/bootstrap/blob/c11132351e3e434f6d4ed72e5a418eb692c6a319/assets/js/src/application.js */
clipboard.on('success', function (e) {
$(e.trigger)
.attr('title', 'Copied!')
.tooltip('_fixTitle')
.tooltip('show')
.tooltip('_fixTitle');
e.clearSelection();
});
</script>
</body>
</html>

95
src/imap_client.php Normal file
View file

@ -0,0 +1,95 @@
<?php
class ImapClient {
/*PhpImap\Mailbox */
private $mailbox;
public function __construct($imapPath, $login, $password) {
$this->mailbox = new PhpImap\Mailbox($imapPath, $login, $password);
}
/**
* returns all mails for the given $user.
* @param $user User
* @return array
*/
public function get_emails(User $user): array {
// Search for mails with the recipient $address in TO or CC.
$mailsIdsTo = imap_sort($this->mailbox->getImapStream(), SORTARRIVAL, true, SE_UID, 'TO "' . $user->address . '"');
$mailsIdsCc = imap_sort($this->mailbox->getImapStream(), SORTARRIVAL, true, SE_UID, 'CC "' . $user->address . '"');
$mail_ids = array_merge($mailsIdsTo, $mailsIdsCc);
$emails = $this->_load_emails($mail_ids, $user);
return $emails;
}
/**
* deletes emails by id and username. The address must match the recipient in the email.
*
* @param $mailid integer imap email id
* @param $user User
* @internal param the $username matching username
* @return true if success
*/
public function delete_email(string $mailid, User $user): bool {
if ($this->load_one_email($mailid, $user) !== null) {
$this->mailbox->deleteMail($mailid);
$this->mailbox->expungeDeletedMails();
return true;
} else {
return false;
}
}
/**
* Load exactly one email, the $address in TO or CC has to match.
*/
public function load_one_email(int $mailid, User $user): ?\PhpImap\IncomingMail {
// in order to avoid https://www.owasp.org/index.php/Top_10_2013-A4-Insecure_Direct_Object_References
// the recipient in the email has to match the $address.
@$emails = $this->_load_emails(array($mailid), $user);
return count($emails) === 1 ? $emails[0] : null;
}
public function load_one_email_fully($download_email_id, $user): ?string {
if ($this->load_one_email($download_email_id, $user) !== null) {
$headers = imap_fetchheader($this->mailbox->getImapStream(), $download_email_id, FT_UID);
$body = imap_body($this->mailbox->getImapStream(), $download_email_id, FT_UID);
return $headers . "\n" . $body;
} else {
return null;
}
}
/**
* Load emails using the $mail_ids, the mails have to match the $address in TO or CC.
* @param $mail_ids array of integer ids
* @param $user User
* @return array of emails
*/
private function _load_emails(array $mail_ids, User $user) {
$emails = array();
foreach ($mail_ids as $id) {
$mail = $this->mailbox->getMail($id);
// imap_search also returns partials matches. The mails have to be filtered again:
if (array_key_exists($user->address, $mail->to) || array_key_exists($user->address, $mail->cc)) {
$emails[] = $mail;
}
}
return $emails;
}
/**
* deletes messages older than X days.
*/
public function delete_old_messages(string $delete_messages_older_than) {
$ids = $this->mailbox->searchMailbox('BEFORE ' . date('d-M-Y', strtotime($delete_messages_older_than)));
foreach ($ids as $id) {
$this->mailbox->deleteMail($id);
}
$this->mailbox->expungeDeletedMails();
}
}

View file

@ -1,150 +0,0 @@
<!doctype html>
<html lang="de" ng-app="app" ng-strict-di>
<head>
<meta charset="utf-8">
<title>Mailbox</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="description" content="Mailbox">
<link rel="shortcut icon" href="favicon.gif" type="image/x-icon">
<link rel="stylesheet" href="client-libs/style.css">
<link rel="stylesheet" href="client-libs/spinner.css">
<link rel="stylesheet" href="client-libs/angular-stickyfill-0.1.0/angular-stickyfill.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/css/bootstrap.min.css"
integrity="sha384-AysaV+vQoT3kOAXZkl02PThvDr8HYKPZhNT5h/CXfBThSRXQ6jW5DO2ekP5ViFdi" crossorigin="anonymous">
</head>
<body>
<div ng-controller="MailboxController as $ctrl" ng-cloak>
<header>
<div class="container">
<form ng-submit="$ctrl.updateUsername($ctrl.inputFieldUsername)">
<small id="emailHelp" class="form-text text-muted">
You have <span class="tag tag-pill tag-default">{{$ctrl.mails.length}}</span> mails in your
mailbox:
</small>
<div class="form-group row">
<div class="col-sm-8">
<input id="inputFieldUsername" ng-model="$ctrl.inputFieldUsername"
placeholder="new username"
type="text" class="form-control form-control-lg" onclick="this.select()"/>
</div>
<div class="col-sm-2">
<button id="openRandomButton" ng-click="$ctrl.randomize()" type="button"
class="btn btn-outline-primary">open random
</button>
</div>
</div>
</form>
</div>
</header>
<main>
<div class="container min-height">
<div ng-if="$ctrl.error" class="alert alert-danger" role="alert">
<p><strong>Sorry, there was a problem. </strong></p>
<p> {{$ctrl.error.desc}} </p>
<div>
<pre>{{$ctrl.error.detail|json}}</pre>
</div>
<p> If you are the developer you might want to check the developer tools console of your web
browser and your php error logs. </p>
</div>
<div ng-if="$ctrl.username && $ctrl.mails.length == 0">
<div class="card waiting-screen">
<div class="card-block">
<p class="lead">Your mailbox <strong>{{$ctrl.address}}</strong> is ready. </p>
<p>Emails will appear here automatically. They will be deleted after 30 days.</p>
<div class="spinner">
<div class="rect1"></div>
<div class="rect2"></div>
<div class="rect3"></div>
<div class="rect4"></div>
<div class="rect5"></div>
</div>
</div>
</div>
</div>
<div ng-if="$ctrl.username" ng-repeat="mail in $ctrl.mails | orderBy:'-date' track by $index"
class="email-table">
<div class="card email">
<div class="card-block header-shadow sticky-header" ec-stickyfill ng-init="htmlTabActive=false">
<div class="row">
<div class="col-sm-8">
<h3 class="card-title">{{mail.subject}}</h3>
</div>
<div class="col-sm-4 text-right">
<form class="form-inline float-xs-right">
<button ng-show="htmlTabActive" class="btn btn-outline-info btn-sm "
ng-click="htmlTabActive=false">show text
</button>
<button ng-show="mail.textHtml && !htmlTabActive"
class="btn btn-outline-info btn-sm"
ng-click="htmlTabActive=true">show html
</button>
<a role="button" class="btn btn-sm btn-outline-primary "
href="{{$ctrl.backend_url}}?download_email_id={{mail.id}}&username={{$ctrl.username}}"
download="true">Download
</a>
<button ng-click="$ctrl.deleteMail(mail, $index)" type="button"
class="btn btn-sm btn-outline-danger">Delete
</button>
</form>
</div>
</div>
<div class="row">
<div class="col-sm-8">
<h6 class="card-subtitle mt-1 text-muted">{{mail.fromName}}
&lt;{{mail.fromAddress}}&gt;</h6>
</div>
<div class="col-sm-4">
<h6 class="card-subtitle mt-1 text-muted" style="text-align: right">{{mail.date}}</h6>
</div>
</div>
</div>
<div class="card-block">
<h6 class="card-subtitle text-muted">To: {{mail.toString}}</h6>
<h6 ng-if="mail.cc" ng-repeat="(address,name) in mail.cc" class="card-subtitle text-muted">CC:
{{address}}</h6>
<div class="mt-2 card-text">
<div ng-if="!htmlTabActive" ng-bind-html="mail.textPlain | nl2br | autolink "></div>
<div ng-if="htmlTabActive" ng-bind-html="mail.textHtml"></div>
</div>
</div>
</div>
</div>
</div>
</main>
</div>
<footer>
<p>Powered by <a href="https://github.com/synox/disposable-mailbox"><strong>synox/disposable-mailbox</strong></a>
| <a href="https://github.com/synox/disposable-mailbox"><span class="octicon octicon-mark-github"></span> Fork
me on github</a></p>
</footer>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular-sanitize.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/autolinker/1.2.0/Autolinker.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chance/1.0.4/chance.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/stickyfill/1.1.4/stickyfill.min.js"></script>
<script src="client-libs/angular-stickyfill-0.1.0/angular-stickyfill.js"></script>
<script src="client-libs/index.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/js-signals/1.0.0/js-signals.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/hasher/1.2.0/hasher.js"></script>
</body>
</html>

40
src/index.php Normal file
View file

@ -0,0 +1,40 @@
<?php
// check for common errors
if (version_compare(phpversion(), '7.2', '<')) {
die("ERROR! The php version isn't high enough, you need at least 7.2 to run this application! But you have: " . phpversion());
}
extension_loaded("imap") || die('ERROR: IMAP extension not loaded. Please see the installation instructions in the README.md');
# load php dependencies:
require_once './vendor/autoload.php';
require_once './config_helper.php';
require_once './User.php';
require_once './imap_client.php';
require_once './controller.php';
load_config();
$imapClient = new ImapClient($config['imap']['url'], $config['imap']['username'], $config['imap']['password']);
if (DisplayEmailsController::matches()) {
DisplayEmailsController::invoke($imapClient, $config);
} elseif (RedirectToAddressController::matches()) {
RedirectToAddressController::invoke($imapClient, $config);
} elseif (RedirectToRandomAddressController::matches()) {
RedirectToRandomAddressController::invoke($imapClient, $config);
} elseif (DownloadEmailController::matches()) {
DownloadEmailController::invoke($imapClient, $config);
} elseif (DeleteEmailController::matches()) {
DeleteEmailController::invoke($imapClient, $config);
} elseif (HasNewMessagesControllerJson::matches()) {
HasNewMessagesControllerJson::invoke($imapClient, $config);
} else {
// If requesting the main site, just redirect to a new random mailbox.
RedirectToRandomAddressController::invoke($imapClient, $config);
}
// delete after each request
$imapClient->delete_old_messages($config['delete_messages_older_than']);

7
src/vendor/autoload.php vendored Normal file
View file

@ -0,0 +1,7 @@
<?php
// autoload.php @generated by Composer
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInitaa0b39385f5e64ad4c25b54d37853f67::getLoader();

View file

@ -55,6 +55,7 @@ class ClassLoader
private $classMap = array();
private $classMapAuthoritative = false;
private $missingClasses = array();
private $apcuPrefix;
public function getPrefixes()
{
@ -271,6 +272,26 @@ class ClassLoader
return $this->classMapAuthoritative;
}
/**
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
*
* @param string|null $apcuPrefix
*/
public function setApcuPrefix($apcuPrefix)
{
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
}
/**
* The APCu prefix in use, or null if APCu caching is not enabled.
*
* @return string|null
*/
public function getApcuPrefix()
{
return $this->apcuPrefix;
}
/**
* Registers this instance as an autoloader.
*
@ -313,11 +334,6 @@ class ClassLoader
*/
public function findFile($class)
{
// work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
if ('\\' == $class[0]) {
$class = substr($class, 1);
}
// class map lookup
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
@ -325,6 +341,12 @@ class ClassLoader
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
return false;
}
if (null !== $this->apcuPrefix) {
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
if ($hit) {
return $file;
}
}
$file = $this->findFileWithExtension($class, '.php');
@ -333,6 +355,10 @@ class ClassLoader
$file = $this->findFileWithExtension($class, '.hh');
}
if (null !== $this->apcuPrefix) {
apcu_add($this->apcuPrefix.$class, $file);
}
if (false === $file) {
// Remember that this class does not exist.
$this->missingClasses[$class] = true;
@ -348,10 +374,14 @@ class ClassLoader
$first = $class[0];
if (isset($this->prefixLengthsPsr4[$first])) {
foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
if (0 === strpos($class, $prefix)) {
foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
$subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos);
$search = $subPath . '\\';
if (isset($this->prefixDirsPsr4[$search])) {
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) {
if (file_exists($file = $dir . $pathEnd)) {
return $file;
}
}

View file

@ -1,5 +1,5 @@
Copyright (c) 2016 Nils Adermann, Jordi Boggiano
Copyright (c) Nils Adermann, Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

10
src/vendor/composer/autoload_files.php vendored Normal file
View file

@ -0,0 +1,10 @@
<?php
// autoload_files.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname(dirname($vendorDir));
return array(
'2cffec82183ee1cea088009cef9a6fc3' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php',
);

View file

@ -6,5 +6,6 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname(dirname($vendorDir));
return array(
'PhpImap' => array($vendorDir . '/php-imap/php-imap/src'),
'PronounceableWord_' => array($vendorDir . '/gnugat/PronounceableWord/src'),
'HTMLPurifier' => array($vendorDir . '/ezyang/htmlpurifier/library'),
);

View file

@ -6,4 +6,6 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname(dirname($vendorDir));
return array(
'PhpImap\\' => array($vendorDir . '/php-imap/php-imap/src/PhpImap'),
'Moment\\' => array($vendorDir . '/fightbulc/moment/src'),
);

View file

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit125dddd280a32cf75b181166154246ec
class ComposerAutoloaderInitaa0b39385f5e64ad4c25b54d37853f67
{
private static $loader;
@ -19,15 +19,15 @@ class ComposerAutoloaderInit125dddd280a32cf75b181166154246ec
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit125dddd280a32cf75b181166154246ec', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitaa0b39385f5e64ad4c25b54d37853f67', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit125dddd280a32cf75b181166154246ec', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitaa0b39385f5e64ad4c25b54d37853f67', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit125dddd280a32cf75b181166154246ec::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitaa0b39385f5e64ad4c25b54d37853f67::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
@ -47,6 +47,24 @@ class ComposerAutoloaderInit125dddd280a32cf75b181166154246ec
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInitaa0b39385f5e64ad4c25b54d37853f67::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequireaa0b39385f5e64ad4c25b54d37853f67($fileIdentifier, $file);
}
return $loader;
}
}
function composerRequireaa0b39385f5e64ad4c25b54d37853f67($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
}
}

61
src/vendor/composer/autoload_static.php vendored Normal file
View file

@ -0,0 +1,61 @@
<?php
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInitaa0b39385f5e64ad4c25b54d37853f67
{
public static $files = array (
'2cffec82183ee1cea088009cef9a6fc3' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php',
);
public static $prefixLengthsPsr4 = array (
'P' =>
array (
'PhpImap\\' => 8,
),
'M' =>
array (
'Moment\\' => 7,
),
);
public static $prefixDirsPsr4 = array (
'PhpImap\\' =>
array (
0 => __DIR__ . '/..' . '/php-imap/php-imap/src/PhpImap',
),
'Moment\\' =>
array (
0 => __DIR__ . '/..' . '/fightbulc/moment/src',
),
);
public static $prefixesPsr0 = array (
'P' =>
array (
'PronounceableWord_' =>
array (
0 => __DIR__ . '/..' . '/gnugat/PronounceableWord/src',
),
),
'H' =>
array (
'HTMLPurifier' =>
array (
0 => __DIR__ . '/..' . '/ezyang/htmlpurifier/library',
),
),
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitaa0b39385f5e64ad4c25b54d37853f67::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitaa0b39385f5e64ad4c25b54d37853f67::$prefixDirsPsr4;
$loader->prefixesPsr0 = ComposerStaticInitaa0b39385f5e64ad4c25b54d37853f67::$prefixesPsr0;
}, null, ClassLoader::class);
}
}

204
src/vendor/composer/installed.json vendored Normal file
View file

@ -0,0 +1,204 @@
[
{
"name": "ezyang/htmlpurifier",
"version": "v4.10.0",
"version_normalized": "4.10.0.0",
"source": {
"type": "git",
"url": "https://github.com/ezyang/htmlpurifier.git",
"reference": "d85d39da4576a6934b72480be6978fb10c860021"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/d85d39da4576a6934b72480be6978fb10c860021",
"reference": "d85d39da4576a6934b72480be6978fb10c860021",
"shasum": ""
},
"require": {
"php": ">=5.2"
},
"require-dev": {
"simpletest/simpletest": "^1.1"
},
"time": "2018-02-23T01:58:20+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-0": {
"HTMLPurifier": "library/"
},
"files": [
"library/HTMLPurifier.composer.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL"
],
"authors": [
{
"name": "Edward Z. Yang",
"email": "admin@htmlpurifier.org",
"homepage": "http://ezyang.com"
}
],
"description": "Standards compliant HTML filter written in PHP",
"homepage": "http://htmlpurifier.org/",
"keywords": [
"html"
]
},
{
"name": "fightbulc/moment",
"version": "1.29.0",
"version_normalized": "1.29.0.0",
"source": {
"type": "git",
"url": "https://github.com/fightbulc/moment.php.git",
"reference": "bd57bba6d00dfa012e7b7b167e7006c6247ce3c8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fightbulc/moment.php/zipball/bd57bba6d00dfa012e7b7b167e7006c6247ce3c8",
"reference": "bd57bba6d00dfa012e7b7b167e7006c6247ce3c8",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.36 || ^5.5 || ^6.5 || ^7.5"
},
"time": "2019-01-07T11:16:45+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"Moment\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Tino Ehrich",
"email": "tino@bigpun.me",
"role": "developer"
}
],
"description": "Parse, validate, manipulate, and display dates in PHP w/ i18n support. Inspired by moment.js",
"keywords": [
"date",
"display",
"format",
"i18n",
"locale",
"manipulate",
"moment",
"parse",
"time",
"translation",
"validate"
]
},
{
"name": "gnugat/PronounceableWord",
"version": "2.0.0",
"version_normalized": "2.0.0.0",
"source": {
"type": "git",
"url": "https://github.com/gnugat-legacy/PronounceableWord.git",
"reference": "fcdc0dc39775fa625040c37003727019657d001b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/gnugat-legacy/PronounceableWord/zipball/fcdc0dc39775fa625040c37003727019657d001b",
"reference": "fcdc0dc39775fa625040c37003727019657d001b",
"shasum": ""
},
"require": {
"php": ">=5.2"
},
"time": "2012-01-08T19:36:58+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-0": {
"PronounceableWord_": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Loïc Chardonnet"
}
],
"description": "A light, customizable and simple library generating random and pronounceable words without using dictionaries or Markov chains.",
"homepage": "https://github.com/gnugat/PronounceableWord",
"keywords": [
"generator",
"pronounceable",
"word"
],
"abandoned": true
},
{
"name": "php-imap/php-imap",
"version": "3.0.6",
"version_normalized": "3.0.6.0",
"source": {
"type": "git",
"url": "https://github.com/barbushin/php-imap.git",
"reference": "d4f8ef4504dfb555857241aa7d1e414a1c229079"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/barbushin/php-imap/zipball/d4f8ef4504dfb555857241aa7d1e414a1c229079",
"reference": "d4f8ef4504dfb555857241aa7d1e414a1c229079",
"shasum": ""
},
"require": {
"ext-imap": "*",
"php": ">=5.5"
},
"time": "2017-12-22T12:53:34+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"PhpImap\\": "src/PhpImap"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Sergey Barbushin",
"email": "barbushin@gmail.com",
"homepage": "http://linkedin.com/in/barbushin"
}
],
"description": "Manage mailboxes, filter/get/delete emails in PHP (supports IMAP/POP3/NNTP)",
"homepage": "https://github.com/barbushin/php-imap",
"keywords": [
"imap",
"mail",
"mailbox",
"php",
"pop3",
"receive emails"
]
}
]

View file

@ -0,0 +1,9 @@
CREDITS
Almost everything written by Edward Z. Yang (Ambush Commander). Lots of thanks
to the DevNetwork Community for their help (see docs/ref-devnetwork.html for
more details), Feyd especially (namely IPv6 and optimization). Thanks to RSnake
for letting me package his fantastic XSS cheatsheet for a smoketest.
vim: et sw=4 sts=4

373
src/vendor/ezyang/htmlpurifier/INSTALL vendored Normal file
View file

@ -0,0 +1,373 @@
Install
How to install HTML Purifier
HTML Purifier is designed to run out of the box, so actually using the
library is extremely easy. (Although... if you were looking for a
step-by-step installation GUI, you've downloaded the wrong software!)
While the impatient can get going immediately with some of the sample
code at the bottom of this library, it's well worth reading this entire
document--most of the other documentation assumes that you are familiar
with these contents.
---------------------------------------------------------------------------
1. Compatibility
HTML Purifier is PHP 5 and PHP 7, and is actively tested from PHP 5.0.5
and up. It has no core dependencies with other libraries.
These optional extensions can enhance the capabilities of HTML Purifier:
* iconv : Converts text to and from non-UTF-8 encodings
* bcmath : Used for unit conversion and imagecrash protection
* tidy : Used for pretty-printing HTML
These optional libraries can enhance the capabilities of HTML Purifier:
* CSSTidy : Clean CSS stylesheets using %Core.ExtractStyleBlocks
Note: You should use the modernized fork of CSSTidy available
at https://github.com/Cerdic/CSSTidy
* Net_IDNA2 (PEAR) : IRI support using %Core.EnableIDNA
Note: This is not necessary for PHP 5.3 or later
---------------------------------------------------------------------------
2. Reconnaissance
A big plus of HTML Purifier is its inerrant support of standards, so
your web-pages should be standards-compliant. (They should also use
semantic markup, but that's another issue altogether, one HTML Purifier
cannot fix without reading your mind.)
HTML Purifier can process these doctypes:
* XHTML 1.0 Transitional (default)
* XHTML 1.0 Strict
* HTML 4.01 Transitional
* HTML 4.01 Strict
* XHTML 1.1
...and these character encodings:
* UTF-8 (default)
* Any encoding iconv supports (with crippled internationalization support)
These defaults reflect what my choices would be if I were authoring an
HTML document, however, what you choose depends on the nature of your
codebase. If you don't know what doctype you are using, you can determine
the doctype from this identifier at the top of your source code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
...and the character encoding from this code:
<meta http-equiv="Content-type" content="text/html;charset=ENCODING">
If the character encoding declaration is missing, STOP NOW, and
read 'docs/enduser-utf8.html' (web accessible at
http://htmlpurifier.org/docs/enduser-utf8.html). In fact, even if it is
present, read this document anyway, as many websites specify their
document's character encoding incorrectly.
---------------------------------------------------------------------------
3. Including the library
The procedure is quite simple:
require_once '/path/to/library/HTMLPurifier.auto.php';
This will setup an autoloader, so the library's files are only included
when you use them.
Only the contents in the library/ folder are necessary, so you can remove
everything else when using HTML Purifier in a production environment.
If you installed HTML Purifier via PEAR, all you need to do is:
require_once 'HTMLPurifier.auto.php';
Please note that the usual PEAR practice of including just the classes you
want will not work with HTML Purifier's autoloading scheme.
Advanced users, read on; other users can skip to section 4.
Autoload compatibility
----------------------
HTML Purifier attempts to be as smart as possible when registering an
autoloader, but there are some cases where you will need to change
your own code to accomodate HTML Purifier. These are those cases:
PHP VERSION IS LESS THAN 5.1.2, AND YOU'VE DEFINED __autoload
Because spl_autoload_register() doesn't exist in early versions
of PHP 5, HTML Purifier has no way of adding itself to the autoload
stack. Modify your __autoload function to test
HTMLPurifier_Bootstrap::autoload($class)
For example, suppose your autoload function looks like this:
function __autoload($class) {
require str_replace('_', '/', $class) . '.php';
return true;
}
A modified version with HTML Purifier would look like this:
function __autoload($class) {
if (HTMLPurifier_Bootstrap::autoload($class)) return true;
require str_replace('_', '/', $class) . '.php';
return true;
}
Note that there *is* some custom behavior in our autoloader; the
original autoloader in our example would work for 99% of the time,
but would fail when including language files.
AN __autoload FUNCTION IS DECLARED AFTER OUR AUTOLOADER IS REGISTERED
spl_autoload_register() has the curious behavior of disabling
the existing __autoload() handler. Users need to explicitly
spl_autoload_register('__autoload'). Because we use SPL when it
is available, __autoload() will ALWAYS be disabled. If __autoload()
is declared before HTML Purifier is loaded, this is not a problem:
HTML Purifier will register the function for you. But if it is
declared afterwards, it will mysteriously not work. This
snippet of code (after your autoloader is defined) will fix it:
spl_autoload_register('__autoload')
Users should also be on guard if they use a version of PHP previous
to 5.1.2 without an autoloader--HTML Purifier will define __autoload()
for you, which can collide with an autoloader that was added by *you*
later.
For better performance
----------------------
Opcode caches, which greatly speed up PHP initialization for scripts
with large amounts of code (HTML Purifier included), don't like
autoloaders. We offer an include file that includes all of HTML Purifier's
files in one go in an opcode cache friendly manner:
// If /path/to/library isn't already in your include path, uncomment
// the below line:
// require '/path/to/library/HTMLPurifier.path.php';
require 'HTMLPurifier.includes.php';
Optional components still need to be included--you'll know if you try to
use a feature and you get a class doesn't exists error! The autoloader
can be used in conjunction with this approach to catch classes that are
missing. Simply add this afterwards:
require 'HTMLPurifier.autoload.php';
Standalone version
------------------
HTML Purifier has a standalone distribution; you can also generate
a standalone file from the full version by running the script
maintenance/generate-standalone.php . The standalone version has the
benefit of having most of its code in one file, so parsing is much
faster and the library is easier to manage.
If HTMLPurifier.standalone.php exists in the library directory, you
can use it like this:
require '/path/to/HTMLPurifier.standalone.php';
This is equivalent to including HTMLPurifier.includes.php, except that
the contents of standalone/ will be added to your path. To override this
behavior, specify a new HTMLPURIFIER_PREFIX where standalone files can
be found (usually, this will be one directory up, the "true" library
directory in full distributions). Don't forget to set your path too!
The autoloader can be added to the end to ensure the classes are
loaded when necessary; otherwise you can manually include them.
To use the autoloader, use this:
require 'HTMLPurifier.autoload.php';
For advanced users
------------------
HTMLPurifier.auto.php performs a number of operations that can be done
individually. These are:
HTMLPurifier.path.php
Puts /path/to/library in the include path. For high performance,
this should be done in php.ini.
HTMLPurifier.autoload.php
Registers our autoload handler HTMLPurifier_Bootstrap::autoload($class).
You can do these operations by yourself--in fact, you must modify your own
autoload handler if you are using a version of PHP earlier than PHP 5.1.2
(See "Autoload compatibility" above).
---------------------------------------------------------------------------
4. Configuration
HTML Purifier is designed to run out-of-the-box, but occasionally HTML
Purifier needs to be told what to do. If you answer no to any of these
questions, read on; otherwise, you can skip to the next section (or, if you're
into configuring things just for the heck of it, skip to 4.3).
* Am I using UTF-8?
* Am I using XHTML 1.0 Transitional?
If you answered no to any of these questions, instantiate a configuration
object and read on:
$config = HTMLPurifier_Config::createDefault();
4.1. Setting a different character encoding
You really shouldn't use any other encoding except UTF-8, especially if you
plan to support multilingual websites (read section three for more details).
However, switching to UTF-8 is not always immediately feasible, so we can
adapt.
HTML Purifier uses iconv to support other character encodings, as such,
any encoding that iconv supports <http://www.gnu.org/software/libiconv/>
HTML Purifier supports with this code:
$config->set('Core.Encoding', /* put your encoding here */);
An example usage for Latin-1 websites (the most common encoding for English
websites):
$config->set('Core.Encoding', 'ISO-8859-1');
Note that HTML Purifier's support for non-Unicode encodings is crippled by the
fact that any character not supported by that encoding will be silently
dropped, EVEN if it is ampersand escaped. If you want to work around
this, you are welcome to read docs/enduser-utf8.html for a fix,
but please be cognizant of the issues the "solution" creates (for this
reason, I do not include the solution in this document).
4.2. Setting a different doctype
For those of you using HTML 4.01 Transitional, you can disable
XHTML output like this:
$config->set('HTML.Doctype', 'HTML 4.01 Transitional');
Other supported doctypes include:
* HTML 4.01 Strict
* HTML 4.01 Transitional
* XHTML 1.0 Strict
* XHTML 1.0 Transitional
* XHTML 1.1
4.3. Other settings
There are more configuration directives which can be read about
here: <http://htmlpurifier.org/live/configdoc/plain.html> They're a bit boring,
but they can help out for those of you who like to exert maximum control over
your code. Some of the more interesting ones are configurable at the
demo <http://htmlpurifier.org/demo.php> and are well worth looking into
for your own system.
For example, you can fine tune allowed elements and attributes, convert
relative URLs to absolute ones, and even autoparagraph input text! These
are, respectively, %HTML.Allowed, %URI.MakeAbsolute and %URI.Base, and
%AutoFormat.AutoParagraph. The %Namespace.Directive naming convention
translates to:
$config->set('Namespace.Directive', $value);
E.g.
$config->set('HTML.Allowed', 'p,b,a[href],i');
$config->set('URI.Base', 'http://www.example.com');
$config->set('URI.MakeAbsolute', true);
$config->set('AutoFormat.AutoParagraph', true);
---------------------------------------------------------------------------
5. Caching
HTML Purifier generates some cache files (generally one or two) to speed up
its execution. For maximum performance, make sure that
library/HTMLPurifier/DefinitionCache/Serializer is writeable by the webserver.
If you are in the library/ folder of HTML Purifier, you can set the
appropriate permissions using:
chmod -R 0755 HTMLPurifier/DefinitionCache/Serializer
If the above command doesn't work, you may need to assign write permissions
to group:
chmod -R 0775 HTMLPurifier/DefinitionCache/Serializer
You can also chmod files via your FTP client; this option
is usually accessible by right clicking the corresponding directory and
then selecting "chmod" or "file permissions".
Starting with 2.0.1, HTML Purifier will generate friendly error messages
that will tell you exactly what you have to chmod the directory to, if in doubt,
follow its advice.
If you are unable or unwilling to give write permissions to the cache
directory, you can either disable the cache (and suffer a performance
hit):
$config->set('Core.DefinitionCache', null);
Or move the cache directory somewhere else (no trailing slash):
$config->set('Cache.SerializerPath', '/home/user/absolute/path');
---------------------------------------------------------------------------
6. Using the code
The interface is mind-numbingly simple:
$purifier = new HTMLPurifier($config);
$clean_html = $purifier->purify( $dirty_html );
That's it! For more examples, check out docs/examples/ (they aren't very
different though). Also, docs/enduser-slow.html gives advice on what to
do if HTML Purifier is slowing down your application.
---------------------------------------------------------------------------
7. Quick install
First, make sure library/HTMLPurifier/DefinitionCache/Serializer is
writable by the webserver (see Section 5: Caching above for details).
If your website is in UTF-8 and XHTML Transitional, use this code:
<?php
require_once '/path/to/htmlpurifier/library/HTMLPurifier.auto.php';
$config = HTMLPurifier_Config::createDefault();
$purifier = new HTMLPurifier($config);
$clean_html = $purifier->purify($dirty_html);
?>
If your website is in a different encoding or doctype, use this code:
<?php
require_once '/path/to/htmlpurifier/library/HTMLPurifier.auto.php';
$config = HTMLPurifier_Config::createDefault();
$config->set('Core.Encoding', 'ISO-8859-1'); // replace with your encoding
$config->set('HTML.Doctype', 'HTML 4.01 Transitional'); // replace with your doctype
$purifier = new HTMLPurifier($config);
$clean_html = $purifier->purify($dirty_html);
?>
vim: et sw=4 sts=4

View file

@ -0,0 +1,60 @@
Installation
Comment installer HTML Purifier
Attention : Ce document est encodé en UTF-8, si les lettres avec des accents
ne s'affichent pas, prenez un meilleur éditeur de texte.
L'installation de HTML Purifier est très simple, parce qu'il n'a pas besoin
de configuration. Pour les utilisateurs impatients, le code se trouve dans le
pied de page, mais je recommande de lire le document.
1. Compatibilité
HTML Purifier fonctionne avec PHP 5. PHP 5.0.5 est la dernière version testée.
Il ne dépend pas d'autres librairies.
Les extensions optionnelles sont iconv (généralement déjà installée) et tidy
(répendue aussi). Si vous utilisez UTF-8 et que vous ne voulez pas l'indentation,
vous pouvez utiliser HTML Purifier sans ces extensions.
2. Inclure la librairie
Quand vous devez l'utilisez, incluez le :
require_once('/path/to/library/HTMLPurifier.auto.php');
Ne pas l'inclure si ce n'est pas nécessaire, car HTML Purifier est lourd.
HTML Purifier utilise "autoload". Si vous avez défini la fonction __autoload,
vous devez ajouter cette fonction :
spl_autoload_register('__autoload')
Plus d'informations dans le document "INSTALL".
3. Installation rapide
Si votre site Web est en UTF-8 et XHTML Transitional, utilisez :
<?php
require_once('/path/to/htmlpurifier/library/HTMLPurifier.auto.php');
$purificateur = new HTMLPurifier();
$html_propre = $purificateur->purify($html_a_purifier);
?>
Sinon, utilisez :
<?php
require_once('/path/to/html/purifier/library/HTMLPurifier.auto.load');
$config = $HTMLPurifier_Config::createDefault();
$config->set('Core', 'Encoding', 'ISO-8859-1'); //Remplacez par votre
encodage
$config->set('Core', 'XHTML', true); //Remplacer par false si HTML 4.01
$purificateur = new HTMLPurifier($config);
$html_propre = $purificateur->purify($html_a_purifier);
?>
vim: et sw=4 sts=4

504
src/vendor/ezyang/htmlpurifier/LICENSE vendored Normal file
View file

@ -0,0 +1,504 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
vim: et sw=4 sts=4

1190
src/vendor/ezyang/htmlpurifier/NEWS vendored Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,29 @@
HTML Purifier [![Build Status](https://secure.travis-ci.org/ezyang/htmlpurifier.svg?branch=master)](http://travis-ci.org/ezyang/htmlpurifier)
=============
HTML Purifier is an HTML filtering solution that uses a unique combination
of robust whitelists and aggressive parsing to ensure that not only are
XSS attacks thwarted, but the resulting HTML is standards compliant.
HTML Purifier is oriented towards richly formatted documents from
untrusted sources that require CSS and a full tag-set. This library can
be configured to accept a more restrictive set of tags, but it won't be
as efficient as more bare-bones parsers. It will, however, do the job
right, which may be more important.
Places to go:
* See INSTALL for a quick installation guide
* See docs/ for developer-oriented documentation, code examples and
an in-depth installation guide.
* See WYSIWYG for information on editors like TinyMCE and FCKeditor
HTML Purifier can be found on the web at: [http://htmlpurifier.org/](http://htmlpurifier.org/)
## Installation
Package available on [Composer](https://packagist.org/packages/ezyang/htmlpurifier).
If you're using Composer to manage dependencies, you can use
$ composer require "ezyang/htmlpurifier":"dev-master"

150
src/vendor/ezyang/htmlpurifier/TODO vendored Normal file
View file

@ -0,0 +1,150 @@
TODO List
= KEY ====================
# Flagship
- Regular
? Maybe I'll Do It
==========================
If no interest is expressed for a feature that may require a considerable
amount of effort to implement, it may get endlessly delayed. Do not be
afraid to cast your vote for the next feature to be implemented!
Things to do as soon as possible:
- http://htmlpurifier.org/phorum/read.php?3,5560,6307#msg-6307
- Think about allowing explicit order of operations hooks for transforms
- Fix "<.<" bug (trailing < is removed if not EOD)
- Build in better internal state dumps and debugging tools for remote
debugging
- Allowed/Allowed* have strange interactions when both set
? Transform lone embeds into object tags
- Deprecated config options that emit warnings when you set them (with'
a way of muting the warning if you really want to)
- Make HTML.Trusted work with Output.FlashCompat
- HTML.Trusted and HTML.SafeObject have funny interaction; general
problem is what to do when a module "supersedes" another
(see also tables and basic tables.) This is a little dicier
because HTML.SafeObject has some extra functionality that
trusted might find useful. See http://htmlpurifier.org/phorum/read.php?3,5762,6100
FUTURE VERSIONS
---------------
4.9 release [OMG CONFIG PONIES]
! Fix Printer. It's from the old days when we didn't have decent XML classes
! Factor demo.php into a set of Printer classes, and then create a stub
file for users here (inside the actual HTML Purifier library)
- Fix error handling with form construction
- Do encoding validation in Printers, or at least, where user data comes in
- Config: Add examples to everything (make built-in which also automatically
gives output)
- Add "register" field to config schemas to eliminate dependence on
naming conventions (try to remember why we ultimately decided on tihs)
5.0 release [HTML 5]
# Swap out code to use html5lib tokenizer and tree-builder
! Allow turning off of FixNesting and required attribute insertion
5.1 release [It's All About Trust] (floating)
# Implement untrusted, dangerous elements/attributes
# Implement IDREF support (harder than it seems, since you cannot have
IDREFs to non-existent IDs)
- Implement <area> (client and server side image maps are blocking
on IDREF support)
# Frameset XHTML 1.0 and HTML 4.01 doctypes
- Figure out how to simultaneously set %CSS.Trusted and %HTML.Trusted (?)
5.2 release [Error'ed]
# Error logging for filtering/cleanup procedures
# Additional support for poorly written HTML
- Microsoft Word HTML cleaning (i.e. MsoNormal, but research essential!)
- Friendly strict handling of <address> (block -> <br>)
- XSS-attempt detection--certain errors are flagged XSS-like
- Append something to duplicate IDs so they're still usable (impl. note: the
dupe detector would also need to detect the suffix as well)
6.0 release [Beyond HTML]
# Legit token based CSS parsing (will require revamping almost every
AttrDef class). Probably will use CSSTidy
# More control over allowed CSS properties using a modularization
# IRI support (this includes IDN)
- Standardize token armor for all areas of processing
7.0 release [To XML and Beyond]
- Extended HTML capabilities based on namespacing and tag transforms (COMPLEX)
- Hooks for adding custom processors to custom namespaced tags and
attributes, offer default implementation
- Lots of documentation and samples
Ongoing
- More refactoring to take advantage of PHP5's facilities
- Refactor unit tests into lots of test methods
- Plugins for major CMSes (COMPLEX)
- phpBB
- Also, a FAQ for extension writers with HTML Purifier
AutoFormat
- Smileys
- Syntax highlighting (with GeSHi) with <pre> and possibly <?php
- Look at http://drupal.org/project/Modules/category/63 for ideas
Neat feature related
! Support exporting configuration, so users can easily tweak settings
in the demo, and then copy-paste into their own setup
- Advanced URI filtering schemes (see docs/proposal-new-directives.txt)
- Allow scoped="scoped" attribute in <style> tags; may be troublesome
because regular CSS has no way of uniquely identifying nodes, so we'd
have to generate IDs
- Explain how to use HTML Purifier in non-PHP languages / create
a simple command line stub (or complicated?)
- Fixes for Firefox's inability to handle COL alignment props (Bug 915)
- Automatically add non-breaking spaces to empty table cells when
empty-cells:show is applied to have compatibility with Internet Explorer
- Table of Contents generation (XHTML Compiler might be reusable). May also
be out-of-band information.
- Full set of color keywords. Also, a way to add onto them without
finalizing the configuration object.
- Write a var_export and memcached DefinitionCache - Denis
- Built-in support for target="_blank" on all external links
- Convert RTL/LTR override characters to <bdo> tags, or vice versa on demand.
Also, enable disabling of directionality
? Externalize inline CSS to promote clean HTML, proposed by Sander Tekelenburg
? Remove redundant tags, ex. <u><u>Underlined</u></u>. Implementation notes:
1. Analyzing which tags to remove duplicants
2. Ensure attributes are merged into the parent tag
3. Extend the tag exclusion system to specify whether or not the
contents should be dropped or not (currently, there's code that could do
something like this if it didn't drop the inner text too.)
? Make AutoParagraph also support paragraph-izing double <br> tags, and not
just double newlines. This is kind of tough to do in the current framework,
though, and might be reasonably approximated by search replacing double <br>s
with newlines before running it through HTML Purifier.
Maintenance related (slightly boring)
# CHMOD install script for PEAR installs
! Factor out command line parser into its own class, and unit test it
- Reduce size of internal data-structures (esp. HTMLDefinition)
- Allow merging configurations. Thus,
a -> b -> default
c -> d -> default
becomes
a -> b -> c -> d -> default
Maybe allow more fine-grained tuning of this behavior. Alternatively,
encourage people to use short plist depths before building them up.
- Time PHPT tests
ChildDef related (very boring)
- Abstract ChildDef_BlockQuote to work with all elements that only
allow blocks in them, required or optional
- Implement lenient <ruby> child validation
Wontfix
- Non-lossy smart alternate character encoding transformations (unless
patch provided)
- Pretty-printing HTML: users can use Tidy on the output on entire page
- Native content compression, whitespace stripping: use gzip if this is
really important
vim: et sw=4 sts=4

View file

@ -0,0 +1 @@
4.10.0

13
src/vendor/ezyang/htmlpurifier/WHATSNEW vendored Normal file
View file

@ -0,0 +1,13 @@
HTML Purifier 4.9.x is a maintenance release, collecting a year
of accumulated bug fixes plus a few new features. New features
include support for min/max-width/height CSS, and rgba/hsl/hsla
in color specifications. Major bugfixes include improvements
in the Serializer cache to avoid chmod'ing directories, better
entity decoding (we won't accidentally encode entities that occur
in URLs) and rel="noopener" on links with target attributes,
to prevent them from overwriting the original frame.
4.9.3 works around an infinite loop bug in PHP 7.1 with the opcode
cache (and has one other, minor bugfix, avoiding using autoloading
when testing for DOMDocument presence). If these bugs do not
affect you, you do not need to upgrade.

20
src/vendor/ezyang/htmlpurifier/WYSIWYG vendored Normal file
View file

@ -0,0 +1,20 @@
WYSIWYG - What You See Is What You Get
HTML Purifier: A Pretty Good Fit for TinyMCE and FCKeditor
Javascript-based WYSIWYG editors, simply stated, are quite amazing. But I've
always been wary about using them due to security issues: they handle the
client-side magic, but once you've been served a piping hot load of unfiltered
HTML, what should be done then? In some situations, you can serve it uncleaned,
since you only offer these facilities to trusted(?) authors.
Unfortunantely, for blog comments and anonymous input, BBCode, Textile and
other markup languages still reign supreme. Put simply: filtering HTML is
hard work, and these WYSIWYG authors don't offer anything to alleviate that
trouble. Therein lies the solution:
HTML Purifier is perfect for filtering pure-HTML input from WYSIWYG editors.
Enough said.
vim: et sw=4 sts=4

View file

@ -0,0 +1,25 @@
{
"name": "ezyang/htmlpurifier",
"description": "Standards compliant HTML filter written in PHP",
"type": "library",
"keywords": ["html"],
"homepage": "http://htmlpurifier.org/",
"license": "LGPL",
"authors": [
{
"name": "Edward Z. Yang",
"email": "admin@htmlpurifier.org",
"homepage": "http://ezyang.com"
}
],
"require": {
"php": ">=5.2"
},
"require-dev": {
"simpletest/simpletest": "^1.1"
},
"autoload": {
"psr-0": { "HTMLPurifier": "library/" },
"files": ["library/HTMLPurifier.composer.php"]
}
}

View file

@ -0,0 +1,91 @@
<?php
/**
* Decorator/extender XSLT processor specifically for HTML documents.
*/
class ConfigDoc_HTMLXSLTProcessor
{
/**
* Instance of XSLTProcessor
*/
protected $xsltProcessor;
public function __construct($proc = false)
{
if ($proc === false) $proc = new XSLTProcessor();
$this->xsltProcessor = $proc;
}
/**
* @note Allows a string $xsl filename to be passed
*/
public function importStylesheet($xsl)
{
if (is_string($xsl)) {
$xsl_file = $xsl;
$xsl = new DOMDocument();
$xsl->load($xsl_file);
}
return $this->xsltProcessor->importStylesheet($xsl);
}
/**
* Transforms an XML file into compatible XHTML based on the stylesheet
* @param $xml XML DOM tree, or string filename
* @return string HTML output
* @todo Rename to transformToXHTML, as transformToHTML is misleading
*/
public function transformToHTML($xml)
{
if (is_string($xml)) {
$dom = new DOMDocument();
$dom->load($xml);
} else {
$dom = $xml;
}
$out = $this->xsltProcessor->transformToXML($dom);
// fudges for HTML backwards compatibility
// assumes that document is XHTML
$out = str_replace('/>', ' />', $out); // <br /> not <br/>
$out = str_replace(' xmlns=""', '', $out); // rm unnecessary xmlns
if (class_exists('Tidy')) {
// cleanup output
$config = array(
'indent' => true,
'output-xhtml' => true,
'wrap' => 80
);
$tidy = new Tidy;
$tidy->parseString($out, $config, 'utf8');
$tidy->cleanRepair();
$out = (string) $tidy;
}
return $out;
}
/**
* Bulk sets parameters for the XSL stylesheet
* @param array $options Associative array of options to set
*/
public function setParameters($options)
{
foreach ($options as $name => $value) {
$this->xsltProcessor->setParameter('', $name, $value);
}
}
/**
* Forward any other calls to the XSLT processor
*/
public function __call($name, $arguments)
{
call_user_func_array(array($this->xsltProcessor, $name), $arguments);
}
}
// vim: et sw=4 sts=4

View file

@ -0,0 +1,164 @@
<?php
/**
* Filesystem tools not provided by default; can recursively create, copy
* and delete folders. Some template methods are provided for extensibility.
*
* @note This class must be instantiated to be used, although it does
* not maintain state.
*/
class FSTools
{
private static $singleton;
/**
* Returns a global instance of FSTools
*/
public static function singleton()
{
if (empty(FSTools::$singleton)) FSTools::$singleton = new FSTools();
return FSTools::$singleton;
}
/**
* Sets our global singleton to something else; useful for overloading
* functions.
*/
public static function setSingleton($singleton)
{
FSTools::$singleton = $singleton;
}
/**
* Recursively creates a directory
* @param string $folder Name of folder to create
* @note Adapted from the PHP manual comment 76612
*/
public function mkdirr($folder)
{
$folders = preg_split("#[\\\\/]#", $folder);
$base = '';
for($i = 0, $c = count($folders); $i < $c; $i++) {
if(empty($folders[$i])) {
if (!$i) {
// special case for root level
$base .= DIRECTORY_SEPARATOR;
}
continue;
}
$base .= $folders[$i];
if(!is_dir($base)){
$this->mkdir($base);
}
$base .= DIRECTORY_SEPARATOR;
}
}
/**
* Copy a file, or recursively copy a folder and its contents; modified
* so that copied files, if PHP, have includes removed
* @note Adapted from http://aidanlister.com/repos/v/function.copyr.php
*/
public function copyr($source, $dest)
{
// Simple copy for a file
if (is_file($source)) {
return $this->copy($source, $dest);
}
// Make destination directory
if (!is_dir($dest)) {
$this->mkdir($dest);
}
// Loop through the folder
$dir = $this->dir($source);
while ( false !== ($entry = $dir->read()) ) {
// Skip pointers
if ($entry == '.' || $entry == '..') {
continue;
}
if (!$this->copyable($entry)) {
continue;
}
// Deep copy directories
if ($dest !== "$source/$entry") {
$this->copyr("$source/$entry", "$dest/$entry");
}
}
// Clean up
$dir->close();
return true;
}
/**
* Overloadable function that tests a filename for copyability. By
* default, everything should be copied; you can restrict things to
* ignore hidden files, unreadable files, etc. This function
* applies to copyr().
*/
public function copyable($file)
{
return true;
}
/**
* Delete a file, or a folder and its contents
* @note Adapted from http://aidanlister.com/repos/v/function.rmdirr.php
*/
public function rmdirr($dirname)
{
// Sanity check
if (!$this->file_exists($dirname)) {
return false;
}
// Simple delete for a file
if ($this->is_file($dirname) || $this->is_link($dirname)) {
return $this->unlink($dirname);
}
// Loop through the folder
$dir = $this->dir($dirname);
while (false !== $entry = $dir->read()) {
// Skip pointers
if ($entry == '.' || $entry == '..') {
continue;
}
// Recurse
$this->rmdirr($dirname . DIRECTORY_SEPARATOR . $entry);
}
// Clean up
$dir->close();
return $this->rmdir($dirname);
}
/**
* Recursively globs a directory.
*/
public function globr($dir, $pattern, $flags = NULL)
{
$files = $this->glob("$dir/$pattern", $flags);
if ($files === false) $files = array();
$sub_dirs = $this->glob("$dir/*", GLOB_ONLYDIR);
if ($sub_dirs === false) $sub_dirs = array();
foreach ($sub_dirs as $sub_dir) {
$sub_files = $this->globr($sub_dir, $pattern, $flags);
$files = array_merge($files, $sub_files);
}
return $files;
}
/**
* Allows for PHP functions to be called and be stubbed.
* @warning This function will not work for functions that need
* to pass references; manually define a stub function for those.
*/
public function __call($name, $args)
{
return call_user_func_array($name, $args);
}
}
// vim: et sw=4 sts=4

View file

@ -0,0 +1,141 @@
<?php
/**
* Represents a file in the filesystem
*
* @warning Be sure to distinguish between get() and write() versus
* read() and put(), the former operates on the entire file, while
* the latter operates on a handle.
*/
class FSTools_File
{
/** Filename of file this object represents */
protected $name;
/** Handle for the file */
protected $handle = false;
/** Instance of FSTools for interfacing with filesystem */
protected $fs;
/**
* Filename of file you wish to instantiate.
* @note This file need not exist
*/
public function __construct($name, $fs = false)
{
$this->name = $name;
$this->fs = $fs ? $fs : FSTools::singleton();
}
/** Returns the filename of the file. */
public function getName() {return $this->name;}
/** Returns directory of the file without trailing slash */
public function getDirectory() {return $this->fs->dirname($this->name);}
/**
* Retrieves the contents of a file
* @todo Throw an exception if file doesn't exist
*/
public function get()
{
return $this->fs->file_get_contents($this->name);
}
/** Writes contents to a file, creates new file if necessary */
public function write($contents)
{
return $this->fs->file_put_contents($this->name, $contents);
}
/** Deletes the file */
public function delete()
{
return $this->fs->unlink($this->name);
}
/** Returns true if file exists and is a file. */
public function exists()
{
return $this->fs->is_file($this->name);
}
/** Returns last file modification time */
public function getMTime()
{
return $this->fs->filemtime($this->name);
}
/**
* Chmod a file
* @note We ignore errors because of some weird owner trickery due
* to SVN duality
*/
public function chmod($octal_code)
{
return @$this->fs->chmod($this->name, $octal_code);
}
/** Opens file's handle */
public function open($mode)
{
if ($this->handle) $this->close();
$this->handle = $this->fs->fopen($this->name, $mode);
return true;
}
/** Closes file's handle */
public function close()
{
if (!$this->handle) return false;
$status = $this->fs->fclose($this->handle);
$this->handle = false;
return $status;
}
/** Retrieves a line from an open file, with optional max length $length */
public function getLine($length = null)
{
if (!$this->handle) $this->open('r');
if ($length === null) return $this->fs->fgets($this->handle);
else return $this->fs->fgets($this->handle, $length);
}
/** Retrieves a character from an open file */
public function getChar()
{
if (!$this->handle) $this->open('r');
return $this->fs->fgetc($this->handle);
}
/** Retrieves an $length bytes of data from an open data */
public function read($length)
{
if (!$this->handle) $this->open('r');
return $this->fs->fread($this->handle, $length);
}
/** Writes to an open file */
public function put($string)
{
if (!$this->handle) $this->open('a');
return $this->fs->fwrite($this->handle, $string);
}
/** Returns TRUE if the end of the file has been reached */
public function eof()
{
if (!$this->handle) return true;
return $this->fs->feof($this->handle);
}
public function __destruct()
{
if ($this->handle) $this->close();
}
}
// vim: et sw=4 sts=4

View file

@ -0,0 +1,11 @@
<?php
/**
* This is a stub include that automatically configures the include path.
*/
set_include_path(dirname(__FILE__) . PATH_SEPARATOR . get_include_path() );
require_once 'HTMLPurifierExtras.php';
require_once 'HTMLPurifierExtras.autoload.php';
// vim: et sw=4 sts=4

View file

@ -0,0 +1,15 @@
<?php
/**
* @file
* Legacy autoloader for systems lacking spl_autoload_register
*
* Must be separate to prevent deprecation warning on PHP 7.2
*/
function __autoload($class)
{
return HTMLPurifierExtras::autoload($class);
}
// vim: et sw=4 sts=4

View file

@ -0,0 +1,23 @@
<?php
/**
* @file
* Convenience file that registers autoload handler for HTML Purifier.
*
* @warning
* This autoloader does not contain the compatibility code seen in
* HTMLPurifier_Bootstrap; the user is expected to make any necessary
* changes to use this library.
*/
if (function_exists('spl_autoload_register')) {
spl_autoload_register(array('HTMLPurifierExtras', 'autoload'));
if (function_exists('__autoload')) {
// Be polite and ensure that userland autoload gets retained
spl_autoload_register('__autoload');
}
} elseif (!function_exists('__autoload')) {
require dirname(__FILE__) . '/HTMLPurifierExtras.autoload-legacy.php';
}
// vim: et sw=4 sts=4

View file

@ -0,0 +1,31 @@
<?php
/**
* Meta-class for HTML Purifier's extra class hierarchies, similar to
* HTMLPurifier_Bootstrap.
*/
class HTMLPurifierExtras
{
public static function autoload($class)
{
$path = HTMLPurifierExtras::getPath($class);
if (!$path) return false;
require $path;
return true;
}
public static function getPath($class)
{
if (
strncmp('FSTools', $class, 7) !== 0 &&
strncmp('ConfigDoc', $class, 9) !== 0
) return false;
// Custom implementations can go here
// Standard implementation:
return str_replace('_', '/', $class) . '.php';
}
}
// vim: et sw=4 sts=4

View file

@ -0,0 +1,32 @@
HTML Purifier Extras
The Method Behind The Madness!
The extras/ folder in HTML Purifier contains--you guessed it--extra things
for HTML Purifier. Specifically, these are two extra libraries called
FSTools and ConfigSchema. They're extra for a reason: you don't need them
if you're using HTML Purifier for normal usage: filtering HTML. However,
if you're a developer, and would like to test HTML Purifier, or need to
use one of HTML Purifier's maintenance scripts, chances are they'll need
these libraries. Who knows: maybe you'll find them useful too!
Here are the libraries:
FSTools
-------
Short for File System Tools, this is a poor-man's object-oriented wrapper for
the filesystem. It currently consists of two classes:
- FSTools: This is a singleton that contains a manner of useful functions
such as recursive glob, directory removal, etc, as well as the ability
to call arbitrary native PHP functions through it like $FS->fopen(...).
This makes it a lot simpler to mock these filesystem calls for unit testing.
- FSTools_File: This object represents a single file, and has almost any
method imaginable one would need.
Check the files themselves for more information.
vim: et sw=4 sts=4

View file

@ -0,0 +1,11 @@
<?php
/**
* This is a stub include that automatically configures the include path.
*/
set_include_path(dirname(__FILE__) . PATH_SEPARATOR . get_include_path() );
require_once 'HTMLPurifier/Bootstrap.php';
require_once 'HTMLPurifier.autoload.php';
// vim: et sw=4 sts=4

View file

@ -0,0 +1,15 @@
<?php
/**
* @file
* Legacy autoloader for systems lacking spl_autoload_register
*
* Must be separate to prevent deprecation warning on PHP 7.2
*/
function __autoload($class)
{
return HTMLPurifier_Bootstrap::autoload($class);
}
// vim: et sw=4 sts=4

View file

@ -0,0 +1,24 @@
<?php
/**
* @file
* Convenience file that registers autoload handler for HTML Purifier.
* It also does some sanity checks.
*/
if (function_exists('spl_autoload_register') && function_exists('spl_autoload_unregister')) {
// We need unregister for our pre-registering functionality
HTMLPurifier_Bootstrap::registerAutoload();
if (function_exists('__autoload')) {
// Be polite and ensure that userland autoload gets retained
spl_autoload_register('__autoload');
}
} elseif (!function_exists('__autoload')) {
require dirname(__FILE__) . '/HTMLPurifier.autoload-legacy.php';
}
if (ini_get('zend.ze1_compatibility_mode')) {
trigger_error("HTML Purifier is not compatible with zend.ze1_compatibility_mode; please turn it off", E_USER_ERROR);
}
// vim: et sw=4 sts=4

View file

@ -0,0 +1,4 @@
<?php
if (!defined('HTMLPURIFIER_PREFIX')) {
define('HTMLPURIFIER_PREFIX', dirname(__FILE__));
}

View file

@ -0,0 +1,25 @@
<?php
/**
* @file
* Defines a function wrapper for HTML Purifier for quick use.
* @note ''HTMLPurifier()'' is NOT the same as ''new HTMLPurifier()''
*/
/**
* Purify HTML.
* @param string $html String HTML to purify
* @param mixed $config Configuration to use, can be any value accepted by
* HTMLPurifier_Config::create()
* @return string
*/
function HTMLPurifier($html, $config = null)
{
static $purifier = false;
if (!$purifier) {
$purifier = new HTMLPurifier();
}
return $purifier->purify($html, $config);
}
// vim: et sw=4 sts=4

View file

@ -0,0 +1,234 @@
<?php
/**
* @file
* This file was auto-generated by generate-includes.php and includes all of
* the core files required by HTML Purifier. Use this if performance is a
* primary concern and you are using an opcode cache. PLEASE DO NOT EDIT THIS
* FILE, changes will be overwritten the next time the script is run.
*
* @version 4.10.0
*
* @warning
* You must *not* include any other HTML Purifier files before this file,
* because 'require' not 'require_once' is used.
*
* @warning
* This file requires that the include path contains the HTML Purifier
* library directory; this is not auto-set.
*/
require 'HTMLPurifier.php';
require 'HTMLPurifier/Arborize.php';
require 'HTMLPurifier/AttrCollections.php';
require 'HTMLPurifier/AttrDef.php';
require 'HTMLPurifier/AttrTransform.php';
require 'HTMLPurifier/AttrTypes.php';
require 'HTMLPurifier/AttrValidator.php';
require 'HTMLPurifier/Bootstrap.php';
require 'HTMLPurifier/Definition.php';
require 'HTMLPurifier/CSSDefinition.php';
require 'HTMLPurifier/ChildDef.php';
require 'HTMLPurifier/Config.php';
require 'HTMLPurifier/ConfigSchema.php';
require 'HTMLPurifier/ContentSets.php';
require 'HTMLPurifier/Context.php';
require 'HTMLPurifier/DefinitionCache.php';
require 'HTMLPurifier/DefinitionCacheFactory.php';
require 'HTMLPurifier/Doctype.php';
require 'HTMLPurifier/DoctypeRegistry.php';
require 'HTMLPurifier/ElementDef.php';
require 'HTMLPurifier/Encoder.php';
require 'HTMLPurifier/EntityLookup.php';
require 'HTMLPurifier/EntityParser.php';
require 'HTMLPurifier/ErrorCollector.php';
require 'HTMLPurifier/ErrorStruct.php';
require 'HTMLPurifier/Exception.php';
require 'HTMLPurifier/Filter.php';
require 'HTMLPurifier/Generator.php';
require 'HTMLPurifier/HTMLDefinition.php';
require 'HTMLPurifier/HTMLModule.php';
require 'HTMLPurifier/HTMLModuleManager.php';
require 'HTMLPurifier/IDAccumulator.php';
require 'HTMLPurifier/Injector.php';
require 'HTMLPurifier/Language.php';
require 'HTMLPurifier/LanguageFactory.php';
require 'HTMLPurifier/Length.php';
require 'HTMLPurifier/Lexer.php';
require 'HTMLPurifier/Node.php';
require 'HTMLPurifier/PercentEncoder.php';
require 'HTMLPurifier/PropertyList.php';
require 'HTMLPurifier/PropertyListIterator.php';
require 'HTMLPurifier/Queue.php';
require 'HTMLPurifier/Strategy.php';
require 'HTMLPurifier/StringHash.php';
require 'HTMLPurifier/StringHashParser.php';
require 'HTMLPurifier/TagTransform.php';
require 'HTMLPurifier/Token.php';
require 'HTMLPurifier/TokenFactory.php';
require 'HTMLPurifier/URI.php';
require 'HTMLPurifier/URIDefinition.php';
require 'HTMLPurifier/URIFilter.php';
require 'HTMLPurifier/URIParser.php';
require 'HTMLPurifier/URIScheme.php';
require 'HTMLPurifier/URISchemeRegistry.php';
require 'HTMLPurifier/UnitConverter.php';
require 'HTMLPurifier/VarParser.php';
require 'HTMLPurifier/VarParserException.php';
require 'HTMLPurifier/Zipper.php';
require 'HTMLPurifier/AttrDef/CSS.php';
require 'HTMLPurifier/AttrDef/Clone.php';
require 'HTMLPurifier/AttrDef/Enum.php';
require 'HTMLPurifier/AttrDef/Integer.php';
require 'HTMLPurifier/AttrDef/Lang.php';
require 'HTMLPurifier/AttrDef/Switch.php';
require 'HTMLPurifier/AttrDef/Text.php';
require 'HTMLPurifier/AttrDef/URI.php';
require 'HTMLPurifier/AttrDef/CSS/Number.php';
require 'HTMLPurifier/AttrDef/CSS/AlphaValue.php';
require 'HTMLPurifier/AttrDef/CSS/Background.php';
require 'HTMLPurifier/AttrDef/CSS/BackgroundPosition.php';
require 'HTMLPurifier/AttrDef/CSS/Border.php';
require 'HTMLPurifier/AttrDef/CSS/Color.php';
require 'HTMLPurifier/AttrDef/CSS/Composite.php';
require 'HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php';
require 'HTMLPurifier/AttrDef/CSS/Filter.php';
require 'HTMLPurifier/AttrDef/CSS/Font.php';
require 'HTMLPurifier/AttrDef/CSS/FontFamily.php';
require 'HTMLPurifier/AttrDef/CSS/Ident.php';
require 'HTMLPurifier/AttrDef/CSS/ImportantDecorator.php';
require 'HTMLPurifier/AttrDef/CSS/Length.php';
require 'HTMLPurifier/AttrDef/CSS/ListStyle.php';
require 'HTMLPurifier/AttrDef/CSS/Multiple.php';
require 'HTMLPurifier/AttrDef/CSS/Percentage.php';
require 'HTMLPurifier/AttrDef/CSS/TextDecoration.php';
require 'HTMLPurifier/AttrDef/CSS/URI.php';
require 'HTMLPurifier/AttrDef/HTML/Bool.php';
require 'HTMLPurifier/AttrDef/HTML/Nmtokens.php';
require 'HTMLPurifier/AttrDef/HTML/Class.php';
require 'HTMLPurifier/AttrDef/HTML/Color.php';
require 'HTMLPurifier/AttrDef/HTML/FrameTarget.php';
require 'HTMLPurifier/AttrDef/HTML/ID.php';
require 'HTMLPurifier/AttrDef/HTML/Pixels.php';
require 'HTMLPurifier/AttrDef/HTML/Length.php';
require 'HTMLPurifier/AttrDef/HTML/LinkTypes.php';
require 'HTMLPurifier/AttrDef/HTML/MultiLength.php';
require 'HTMLPurifier/AttrDef/URI/Email.php';
require 'HTMLPurifier/AttrDef/URI/Host.php';
require 'HTMLPurifier/AttrDef/URI/IPv4.php';
require 'HTMLPurifier/AttrDef/URI/IPv6.php';
require 'HTMLPurifier/AttrDef/URI/Email/SimpleCheck.php';
require 'HTMLPurifier/AttrTransform/Background.php';
require 'HTMLPurifier/AttrTransform/BdoDir.php';
require 'HTMLPurifier/AttrTransform/BgColor.php';
require 'HTMLPurifier/AttrTransform/BoolToCSS.php';
require 'HTMLPurifier/AttrTransform/Border.php';
require 'HTMLPurifier/AttrTransform/EnumToCSS.php';
require 'HTMLPurifier/AttrTransform/ImgRequired.php';
require 'HTMLPurifier/AttrTransform/ImgSpace.php';
require 'HTMLPurifier/AttrTransform/Input.php';
require 'HTMLPurifier/AttrTransform/Lang.php';
require 'HTMLPurifier/AttrTransform/Length.php';
require 'HTMLPurifier/AttrTransform/Name.php';
require 'HTMLPurifier/AttrTransform/NameSync.php';
require 'HTMLPurifier/AttrTransform/Nofollow.php';
require 'HTMLPurifier/AttrTransform/SafeEmbed.php';
require 'HTMLPurifier/AttrTransform/SafeObject.php';
require 'HTMLPurifier/AttrTransform/SafeParam.php';
require 'HTMLPurifier/AttrTransform/ScriptRequired.php';
require 'HTMLPurifier/AttrTransform/TargetBlank.php';
require 'HTMLPurifier/AttrTransform/TargetNoopener.php';
require 'HTMLPurifier/AttrTransform/TargetNoreferrer.php';
require 'HTMLPurifier/AttrTransform/Textarea.php';
require 'HTMLPurifier/ChildDef/Chameleon.php';
require 'HTMLPurifier/ChildDef/Custom.php';
require 'HTMLPurifier/ChildDef/Empty.php';
require 'HTMLPurifier/ChildDef/List.php';
require 'HTMLPurifier/ChildDef/Required.php';
require 'HTMLPurifier/ChildDef/Optional.php';
require 'HTMLPurifier/ChildDef/StrictBlockquote.php';
require 'HTMLPurifier/ChildDef/Table.php';
require 'HTMLPurifier/DefinitionCache/Decorator.php';
require 'HTMLPurifier/DefinitionCache/Null.php';
require 'HTMLPurifier/DefinitionCache/Serializer.php';
require 'HTMLPurifier/DefinitionCache/Decorator/Cleanup.php';
require 'HTMLPurifier/DefinitionCache/Decorator/Memory.php';
require 'HTMLPurifier/HTMLModule/Bdo.php';
require 'HTMLPurifier/HTMLModule/CommonAttributes.php';
require 'HTMLPurifier/HTMLModule/Edit.php';
require 'HTMLPurifier/HTMLModule/Forms.php';
require 'HTMLPurifier/HTMLModule/Hypertext.php';
require 'HTMLPurifier/HTMLModule/Iframe.php';
require 'HTMLPurifier/HTMLModule/Image.php';
require 'HTMLPurifier/HTMLModule/Legacy.php';
require 'HTMLPurifier/HTMLModule/List.php';
require 'HTMLPurifier/HTMLModule/Name.php';
require 'HTMLPurifier/HTMLModule/Nofollow.php';
require 'HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php';
require 'HTMLPurifier/HTMLModule/Object.php';
require 'HTMLPurifier/HTMLModule/Presentation.php';
require 'HTMLPurifier/HTMLModule/Proprietary.php';
require 'HTMLPurifier/HTMLModule/Ruby.php';
require 'HTMLPurifier/HTMLModule/SafeEmbed.php';
require 'HTMLPurifier/HTMLModule/SafeObject.php';
require 'HTMLPurifier/HTMLModule/SafeScripting.php';
require 'HTMLPurifier/HTMLModule/Scripting.php';
require 'HTMLPurifier/HTMLModule/StyleAttribute.php';
require 'HTMLPurifier/HTMLModule/Tables.php';
require 'HTMLPurifier/HTMLModule/Target.php';
require 'HTMLPurifier/HTMLModule/TargetBlank.php';
require 'HTMLPurifier/HTMLModule/TargetNoopener.php';
require 'HTMLPurifier/HTMLModule/TargetNoreferrer.php';
require 'HTMLPurifier/HTMLModule/Text.php';
require 'HTMLPurifier/HTMLModule/Tidy.php';
require 'HTMLPurifier/HTMLModule/XMLCommonAttributes.php';
require 'HTMLPurifier/HTMLModule/Tidy/Name.php';
require 'HTMLPurifier/HTMLModule/Tidy/Proprietary.php';
require 'HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php';
require 'HTMLPurifier/HTMLModule/Tidy/Strict.php';
require 'HTMLPurifier/HTMLModule/Tidy/Transitional.php';
require 'HTMLPurifier/HTMLModule/Tidy/XHTML.php';
require 'HTMLPurifier/Injector/AutoParagraph.php';
require 'HTMLPurifier/Injector/DisplayLinkURI.php';
require 'HTMLPurifier/Injector/Linkify.php';
require 'HTMLPurifier/Injector/PurifierLinkify.php';
require 'HTMLPurifier/Injector/RemoveEmpty.php';
require 'HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php';
require 'HTMLPurifier/Injector/SafeObject.php';
require 'HTMLPurifier/Lexer/DOMLex.php';
require 'HTMLPurifier/Lexer/DirectLex.php';
require 'HTMLPurifier/Node/Comment.php';
require 'HTMLPurifier/Node/Element.php';
require 'HTMLPurifier/Node/Text.php';
require 'HTMLPurifier/Strategy/Composite.php';
require 'HTMLPurifier/Strategy/Core.php';
require 'HTMLPurifier/Strategy/FixNesting.php';
require 'HTMLPurifier/Strategy/MakeWellFormed.php';
require 'HTMLPurifier/Strategy/RemoveForeignElements.php';
require 'HTMLPurifier/Strategy/ValidateAttributes.php';
require 'HTMLPurifier/TagTransform/Font.php';
require 'HTMLPurifier/TagTransform/Simple.php';
require 'HTMLPurifier/Token/Comment.php';
require 'HTMLPurifier/Token/Tag.php';
require 'HTMLPurifier/Token/Empty.php';
require 'HTMLPurifier/Token/End.php';
require 'HTMLPurifier/Token/Start.php';
require 'HTMLPurifier/Token/Text.php';
require 'HTMLPurifier/URIFilter/DisableExternal.php';
require 'HTMLPurifier/URIFilter/DisableExternalResources.php';
require 'HTMLPurifier/URIFilter/DisableResources.php';
require 'HTMLPurifier/URIFilter/HostBlacklist.php';
require 'HTMLPurifier/URIFilter/MakeAbsolute.php';
require 'HTMLPurifier/URIFilter/Munge.php';
require 'HTMLPurifier/URIFilter/SafeIframe.php';
require 'HTMLPurifier/URIScheme/data.php';
require 'HTMLPurifier/URIScheme/file.php';
require 'HTMLPurifier/URIScheme/ftp.php';
require 'HTMLPurifier/URIScheme/http.php';
require 'HTMLPurifier/URIScheme/https.php';
require 'HTMLPurifier/URIScheme/mailto.php';
require 'HTMLPurifier/URIScheme/news.php';
require 'HTMLPurifier/URIScheme/nntp.php';
require 'HTMLPurifier/URIScheme/tel.php';
require 'HTMLPurifier/VarParser/Flexible.php';
require 'HTMLPurifier/VarParser/Native.php';

View file

@ -0,0 +1,30 @@
<?php
/**
* @file
* Emulation layer for code that used kses(), substituting in HTML Purifier.
*/
require_once dirname(__FILE__) . '/HTMLPurifier.auto.php';
function kses($string, $allowed_html, $allowed_protocols = null)
{
$config = HTMLPurifier_Config::createDefault();
$allowed_elements = array();
$allowed_attributes = array();
foreach ($allowed_html as $element => $attributes) {
$allowed_elements[$element] = true;
foreach ($attributes as $attribute => $x) {
$allowed_attributes["$element.$attribute"] = true;
}
}
$config->set('HTML.AllowedElements', $allowed_elements);
$config->set('HTML.AllowedAttributes', $allowed_attributes);
if ($allowed_protocols !== null) {
$config->set('URI.AllowedSchemes', $allowed_protocols);
}
$purifier = new HTMLPurifier($config);
return $purifier->purify($string);
}
// vim: et sw=4 sts=4

View file

@ -0,0 +1,11 @@
<?php
/**
* @file
* Convenience stub file that adds HTML Purifier's library file to the path
* without any other side-effects.
*/
set_include_path(dirname(__FILE__) . PATH_SEPARATOR . get_include_path() );
// vim: et sw=4 sts=4

View file

@ -0,0 +1,292 @@
<?php
/*! @mainpage
*
* HTML Purifier is an HTML filter that will take an arbitrary snippet of
* HTML and rigorously test, validate and filter it into a version that
* is safe for output onto webpages. It achieves this by:
*
* -# Lexing (parsing into tokens) the document,
* -# Executing various strategies on the tokens:
* -# Removing all elements not in the whitelist,
* -# Making the tokens well-formed,
* -# Fixing the nesting of the nodes, and
* -# Validating attributes of the nodes; and
* -# Generating HTML from the purified tokens.
*
* However, most users will only need to interface with the HTMLPurifier
* and HTMLPurifier_Config.
*/
/*
HTML Purifier 4.10.0 - Standards Compliant HTML Filtering
Copyright (C) 2006-2008 Edward Z. Yang
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* Facade that coordinates HTML Purifier's subsystems in order to purify HTML.
*
* @note There are several points in which configuration can be specified
* for HTML Purifier. The precedence of these (from lowest to
* highest) is as follows:
* -# Instance: new HTMLPurifier($config)
* -# Invocation: purify($html, $config)
* These configurations are entirely independent of each other and
* are *not* merged (this behavior may change in the future).
*
* @todo We need an easier way to inject strategies using the configuration
* object.
*/
class HTMLPurifier
{
/**
* Version of HTML Purifier.
* @type string
*/
public $version = '4.10.0';
/**
* Constant with version of HTML Purifier.
*/
const VERSION = '4.10.0';
/**
* Global configuration object.
* @type HTMLPurifier_Config
*/
public $config;
/**
* Array of extra filter objects to run on HTML,
* for backwards compatibility.
* @type HTMLPurifier_Filter[]
*/
private $filters = array();
/**
* Single instance of HTML Purifier.
* @type HTMLPurifier
*/
private static $instance;
/**
* @type HTMLPurifier_Strategy_Core
*/
protected $strategy;
/**
* @type HTMLPurifier_Generator
*/
protected $generator;
/**
* Resultant context of last run purification.
* Is an array of contexts if the last called method was purifyArray().
* @type HTMLPurifier_Context
*/
public $context;
/**
* Initializes the purifier.
*
* @param HTMLPurifier_Config|mixed $config Optional HTMLPurifier_Config object
* for all instances of the purifier, if omitted, a default
* configuration is supplied (which can be overridden on a
* per-use basis).
* The parameter can also be any type that
* HTMLPurifier_Config::create() supports.
*/
public function __construct($config = null)
{
$this->config = HTMLPurifier_Config::create($config);
$this->strategy = new HTMLPurifier_Strategy_Core();
}
/**
* Adds a filter to process the output. First come first serve
*
* @param HTMLPurifier_Filter $filter HTMLPurifier_Filter object
*/
public function addFilter($filter)
{
trigger_error(
'HTMLPurifier->addFilter() is deprecated, use configuration directives' .
' in the Filter namespace or Filter.Custom',
E_USER_WARNING
);
$this->filters[] = $filter;
}
/**
* Filters an HTML snippet/document to be XSS-free and standards-compliant.
*
* @param string $html String of HTML to purify
* @param HTMLPurifier_Config $config Config object for this operation,
* if omitted, defaults to the config object specified during this
* object's construction. The parameter can also be any type
* that HTMLPurifier_Config::create() supports.
*
* @return string Purified HTML
*/
public function purify($html, $config = null)
{
// :TODO: make the config merge in, instead of replace
$config = $config ? HTMLPurifier_Config::create($config) : $this->config;
// implementation is partially environment dependant, partially
// configuration dependant
$lexer = HTMLPurifier_Lexer::create($config);
$context = new HTMLPurifier_Context();
// setup HTML generator
$this->generator = new HTMLPurifier_Generator($config, $context);
$context->register('Generator', $this->generator);
// set up global context variables
if ($config->get('Core.CollectErrors')) {
// may get moved out if other facilities use it
$language_factory = HTMLPurifier_LanguageFactory::instance();
$language = $language_factory->create($config, $context);
$context->register('Locale', $language);
$error_collector = new HTMLPurifier_ErrorCollector($context);
$context->register('ErrorCollector', $error_collector);
}
// setup id_accumulator context, necessary due to the fact that
// AttrValidator can be called from many places
$id_accumulator = HTMLPurifier_IDAccumulator::build($config, $context);
$context->register('IDAccumulator', $id_accumulator);
$html = HTMLPurifier_Encoder::convertToUTF8($html, $config, $context);
// setup filters
$filter_flags = $config->getBatch('Filter');
$custom_filters = $filter_flags['Custom'];
unset($filter_flags['Custom']);
$filters = array();
foreach ($filter_flags as $filter => $flag) {
if (!$flag) {
continue;
}
if (strpos($filter, '.') !== false) {
continue;
}
$class = "HTMLPurifier_Filter_$filter";
$filters[] = new $class;
}
foreach ($custom_filters as $filter) {
// maybe "HTMLPurifier_Filter_$filter", but be consistent with AutoFormat
$filters[] = $filter;
}
$filters = array_merge($filters, $this->filters);
// maybe prepare(), but later
for ($i = 0, $filter_size = count($filters); $i < $filter_size; $i++) {
$html = $filters[$i]->preFilter($html, $config, $context);
}
// purified HTML
$html =
$this->generator->generateFromTokens(
// list of tokens
$this->strategy->execute(
// list of un-purified tokens
$lexer->tokenizeHTML(
// un-purified HTML
$html,
$config,
$context
),
$config,
$context
)
);
for ($i = $filter_size - 1; $i >= 0; $i--) {
$html = $filters[$i]->postFilter($html, $config, $context);
}
$html = HTMLPurifier_Encoder::convertFromUTF8($html, $config, $context);
$this->context =& $context;
return $html;
}
/**
* Filters an array of HTML snippets
*
* @param string[] $array_of_html Array of html snippets
* @param HTMLPurifier_Config $config Optional config object for this operation.
* See HTMLPurifier::purify() for more details.
*
* @return string[] Array of purified HTML
*/
public function purifyArray($array_of_html, $config = null)
{
$context_array = array();
foreach ($array_of_html as $key => $html) {
$array_of_html[$key] = $this->purify($html, $config);
$context_array[$key] = $this->context;
}
$this->context = $context_array;
return $array_of_html;
}
/**
* Singleton for enforcing just one HTML Purifier in your system
*
* @param HTMLPurifier|HTMLPurifier_Config $prototype Optional prototype
* HTMLPurifier instance to overload singleton with,
* or HTMLPurifier_Config instance to configure the
* generated version with.
*
* @return HTMLPurifier
*/
public static function instance($prototype = null)
{
if (!self::$instance || $prototype) {
if ($prototype instanceof HTMLPurifier) {
self::$instance = $prototype;
} elseif ($prototype) {
self::$instance = new HTMLPurifier($prototype);
} else {
self::$instance = new HTMLPurifier();
}
}
return self::$instance;
}
/**
* Singleton for enforcing just one HTML Purifier in your system
*
* @param HTMLPurifier|HTMLPurifier_Config $prototype Optional prototype
* HTMLPurifier instance to overload singleton with,
* or HTMLPurifier_Config instance to configure the
* generated version with.
*
* @return HTMLPurifier
* @note Backwards compatibility, see instance()
*/
public static function getInstance($prototype = null)
{
return HTMLPurifier::instance($prototype);
}
}
// vim: et sw=4 sts=4

View file

@ -0,0 +1,228 @@
<?php
/**
* @file
* This file was auto-generated by generate-includes.php and includes all of
* the core files required by HTML Purifier. This is a convenience stub that
* includes all files using dirname(__FILE__) and require_once. PLEASE DO NOT
* EDIT THIS FILE, changes will be overwritten the next time the script is run.
*
* Changes to include_path are not necessary.
*/
$__dir = dirname(__FILE__);
require_once $__dir . '/HTMLPurifier.php';
require_once $__dir . '/HTMLPurifier/Arborize.php';
require_once $__dir . '/HTMLPurifier/AttrCollections.php';
require_once $__dir . '/HTMLPurifier/AttrDef.php';
require_once $__dir . '/HTMLPurifier/AttrTransform.php';
require_once $__dir . '/HTMLPurifier/AttrTypes.php';
require_once $__dir . '/HTMLPurifier/AttrValidator.php';
require_once $__dir . '/HTMLPurifier/Bootstrap.php';
require_once $__dir . '/HTMLPurifier/Definition.php';
require_once $__dir . '/HTMLPurifier/CSSDefinition.php';
require_once $__dir . '/HTMLPurifier/ChildDef.php';
require_once $__dir . '/HTMLPurifier/Config.php';
require_once $__dir . '/HTMLPurifier/ConfigSchema.php';
require_once $__dir . '/HTMLPurifier/ContentSets.php';
require_once $__dir . '/HTMLPurifier/Context.php';
require_once $__dir . '/HTMLPurifier/DefinitionCache.php';
require_once $__dir . '/HTMLPurifier/DefinitionCacheFactory.php';
require_once $__dir . '/HTMLPurifier/Doctype.php';
require_once $__dir . '/HTMLPurifier/DoctypeRegistry.php';
require_once $__dir . '/HTMLPurifier/ElementDef.php';
require_once $__dir . '/HTMLPurifier/Encoder.php';
require_once $__dir . '/HTMLPurifier/EntityLookup.php';
require_once $__dir . '/HTMLPurifier/EntityParser.php';
require_once $__dir . '/HTMLPurifier/ErrorCollector.php';
require_once $__dir . '/HTMLPurifier/ErrorStruct.php';
require_once $__dir . '/HTMLPurifier/Exception.php';
require_once $__dir . '/HTMLPurifier/Filter.php';
require_once $__dir . '/HTMLPurifier/Generator.php';
require_once $__dir . '/HTMLPurifier/HTMLDefinition.php';
require_once $__dir . '/HTMLPurifier/HTMLModule.php';
require_once $__dir . '/HTMLPurifier/HTMLModuleManager.php';
require_once $__dir . '/HTMLPurifier/IDAccumulator.php';
require_once $__dir . '/HTMLPurifier/Injector.php';
require_once $__dir . '/HTMLPurifier/Language.php';
require_once $__dir . '/HTMLPurifier/LanguageFactory.php';
require_once $__dir . '/HTMLPurifier/Length.php';
require_once $__dir . '/HTMLPurifier/Lexer.php';
require_once $__dir . '/HTMLPurifier/Node.php';
require_once $__dir . '/HTMLPurifier/PercentEncoder.php';
require_once $__dir . '/HTMLPurifier/PropertyList.php';
require_once $__dir . '/HTMLPurifier/PropertyListIterator.php';
require_once $__dir . '/HTMLPurifier/Queue.php';
require_once $__dir . '/HTMLPurifier/Strategy.php';
require_once $__dir . '/HTMLPurifier/StringHash.php';
require_once $__dir . '/HTMLPurifier/StringHashParser.php';
require_once $__dir . '/HTMLPurifier/TagTransform.php';
require_once $__dir . '/HTMLPurifier/Token.php';
require_once $__dir . '/HTMLPurifier/TokenFactory.php';
require_once $__dir . '/HTMLPurifier/URI.php';
require_once $__dir . '/HTMLPurifier/URIDefinition.php';
require_once $__dir . '/HTMLPurifier/URIFilter.php';
require_once $__dir . '/HTMLPurifier/URIParser.php';
require_once $__dir . '/HTMLPurifier/URIScheme.php';
require_once $__dir . '/HTMLPurifier/URISchemeRegistry.php';
require_once $__dir . '/HTMLPurifier/UnitConverter.php';
require_once $__dir . '/HTMLPurifier/VarParser.php';
require_once $__dir . '/HTMLPurifier/VarParserException.php';
require_once $__dir . '/HTMLPurifier/Zipper.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS.php';
require_once $__dir . '/HTMLPurifier/AttrDef/Clone.php';
require_once $__dir . '/HTMLPurifier/AttrDef/Enum.php';
require_once $__dir . '/HTMLPurifier/AttrDef/Integer.php';
require_once $__dir . '/HTMLPurifier/AttrDef/Lang.php';
require_once $__dir . '/HTMLPurifier/AttrDef/Switch.php';
require_once $__dir . '/HTMLPurifier/AttrDef/Text.php';
require_once $__dir . '/HTMLPurifier/AttrDef/URI.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Number.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/AlphaValue.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Background.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Border.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Color.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Composite.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Filter.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Font.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/FontFamily.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Ident.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Length.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/ListStyle.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Multiple.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Percentage.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/TextDecoration.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/URI.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Bool.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Nmtokens.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Class.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Color.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/FrameTarget.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/ID.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Pixels.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Length.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/LinkTypes.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/MultiLength.php';
require_once $__dir . '/HTMLPurifier/AttrDef/URI/Email.php';
require_once $__dir . '/HTMLPurifier/AttrDef/URI/Host.php';
require_once $__dir . '/HTMLPurifier/AttrDef/URI/IPv4.php';
require_once $__dir . '/HTMLPurifier/AttrDef/URI/IPv6.php';
require_once $__dir . '/HTMLPurifier/AttrDef/URI/Email/SimpleCheck.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/Background.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/BdoDir.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/BgColor.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/BoolToCSS.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/Border.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/EnumToCSS.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/ImgRequired.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/ImgSpace.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/Input.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/Lang.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/Length.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/Name.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/NameSync.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/Nofollow.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/SafeEmbed.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/SafeObject.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/SafeParam.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/ScriptRequired.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/TargetBlank.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/TargetNoopener.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/TargetNoreferrer.php';
require_once $__dir . '/HTMLPurifier/AttrTransform/Textarea.php';
require_once $__dir . '/HTMLPurifier/ChildDef/Chameleon.php';
require_once $__dir . '/HTMLPurifier/ChildDef/Custom.php';
require_once $__dir . '/HTMLPurifier/ChildDef/Empty.php';
require_once $__dir . '/HTMLPurifier/ChildDef/List.php';
require_once $__dir . '/HTMLPurifier/ChildDef/Required.php';
require_once $__dir . '/HTMLPurifier/ChildDef/Optional.php';
require_once $__dir . '/HTMLPurifier/ChildDef/StrictBlockquote.php';
require_once $__dir . '/HTMLPurifier/ChildDef/Table.php';
require_once $__dir . '/HTMLPurifier/DefinitionCache/Decorator.php';
require_once $__dir . '/HTMLPurifier/DefinitionCache/Null.php';
require_once $__dir . '/HTMLPurifier/DefinitionCache/Serializer.php';
require_once $__dir . '/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php';
require_once $__dir . '/HTMLPurifier/DefinitionCache/Decorator/Memory.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Bdo.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/CommonAttributes.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Edit.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Forms.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Hypertext.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Iframe.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Image.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Legacy.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/List.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Name.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Nofollow.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Object.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Presentation.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Proprietary.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Ruby.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/SafeEmbed.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/SafeObject.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/SafeScripting.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Scripting.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/StyleAttribute.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Tables.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Target.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/TargetBlank.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/TargetNoopener.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/TargetNoreferrer.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Text.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/XMLCommonAttributes.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/Name.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/Proprietary.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/Strict.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/Transitional.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/XHTML.php';
require_once $__dir . '/HTMLPurifier/Injector/AutoParagraph.php';
require_once $__dir . '/HTMLPurifier/Injector/DisplayLinkURI.php';
require_once $__dir . '/HTMLPurifier/Injector/Linkify.php';
require_once $__dir . '/HTMLPurifier/Injector/PurifierLinkify.php';
require_once $__dir . '/HTMLPurifier/Injector/RemoveEmpty.php';
require_once $__dir . '/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php';
require_once $__dir . '/HTMLPurifier/Injector/SafeObject.php';
require_once $__dir . '/HTMLPurifier/Lexer/DOMLex.php';
require_once $__dir . '/HTMLPurifier/Lexer/DirectLex.php';
require_once $__dir . '/HTMLPurifier/Node/Comment.php';
require_once $__dir . '/HTMLPurifier/Node/Element.php';
require_once $__dir . '/HTMLPurifier/Node/Text.php';
require_once $__dir . '/HTMLPurifier/Strategy/Composite.php';
require_once $__dir . '/HTMLPurifier/Strategy/Core.php';
require_once $__dir . '/HTMLPurifier/Strategy/FixNesting.php';
require_once $__dir . '/HTMLPurifier/Strategy/MakeWellFormed.php';
require_once $__dir . '/HTMLPurifier/Strategy/RemoveForeignElements.php';
require_once $__dir . '/HTMLPurifier/Strategy/ValidateAttributes.php';
require_once $__dir . '/HTMLPurifier/TagTransform/Font.php';
require_once $__dir . '/HTMLPurifier/TagTransform/Simple.php';
require_once $__dir . '/HTMLPurifier/Token/Comment.php';
require_once $__dir . '/HTMLPurifier/Token/Tag.php';
require_once $__dir . '/HTMLPurifier/Token/Empty.php';
require_once $__dir . '/HTMLPurifier/Token/End.php';
require_once $__dir . '/HTMLPurifier/Token/Start.php';
require_once $__dir . '/HTMLPurifier/Token/Text.php';
require_once $__dir . '/HTMLPurifier/URIFilter/DisableExternal.php';
require_once $__dir . '/HTMLPurifier/URIFilter/DisableExternalResources.php';
require_once $__dir . '/HTMLPurifier/URIFilter/DisableResources.php';
require_once $__dir . '/HTMLPurifier/URIFilter/HostBlacklist.php';
require_once $__dir . '/HTMLPurifier/URIFilter/MakeAbsolute.php';
require_once $__dir . '/HTMLPurifier/URIFilter/Munge.php';
require_once $__dir . '/HTMLPurifier/URIFilter/SafeIframe.php';
require_once $__dir . '/HTMLPurifier/URIScheme/data.php';
require_once $__dir . '/HTMLPurifier/URIScheme/file.php';
require_once $__dir . '/HTMLPurifier/URIScheme/ftp.php';
require_once $__dir . '/HTMLPurifier/URIScheme/http.php';
require_once $__dir . '/HTMLPurifier/URIScheme/https.php';
require_once $__dir . '/HTMLPurifier/URIScheme/mailto.php';
require_once $__dir . '/HTMLPurifier/URIScheme/news.php';
require_once $__dir . '/HTMLPurifier/URIScheme/nntp.php';
require_once $__dir . '/HTMLPurifier/URIScheme/tel.php';
require_once $__dir . '/HTMLPurifier/VarParser/Flexible.php';
require_once $__dir . '/HTMLPurifier/VarParser/Native.php';

View file

@ -0,0 +1,71 @@
<?php
/**
* Converts a stream of HTMLPurifier_Token into an HTMLPurifier_Node,
* and back again.
*
* @note This transformation is not an equivalence. We mutate the input
* token stream to make it so; see all [MUT] markers in code.
*/
class HTMLPurifier_Arborize
{
public static function arborize($tokens, $config, $context) {
$definition = $config->getHTMLDefinition();
$parent = new HTMLPurifier_Token_Start($definition->info_parent);
$stack = array($parent->toNode());
foreach ($tokens as $token) {
$token->skip = null; // [MUT]
$token->carryover = null; // [MUT]
if ($token instanceof HTMLPurifier_Token_End) {
$token->start = null; // [MUT]
$r = array_pop($stack);
//assert($r->name === $token->name);
//assert(empty($token->attr));
$r->endCol = $token->col;
$r->endLine = $token->line;
$r->endArmor = $token->armor;
continue;
}
$node = $token->toNode();
$stack[count($stack)-1]->children[] = $node;
if ($token instanceof HTMLPurifier_Token_Start) {
$stack[] = $node;
}
}
//assert(count($stack) == 1);
return $stack[0];
}
public static function flatten($node, $config, $context) {
$level = 0;
$nodes = array($level => new HTMLPurifier_Queue(array($node)));
$closingTokens = array();
$tokens = array();
do {
while (!$nodes[$level]->isEmpty()) {
$node = $nodes[$level]->shift(); // FIFO
list($start, $end) = $node->toTokenPair();
if ($level > 0) {
$tokens[] = $start;
}
if ($end !== NULL) {
$closingTokens[$level][] = $end;
}
if ($node instanceof HTMLPurifier_Node_Element) {
$level++;
$nodes[$level] = new HTMLPurifier_Queue();
foreach ($node->children as $childNode) {
$nodes[$level]->push($childNode);
}
}
}
$level--;
if ($level && isset($closingTokens[$level])) {
while ($token = array_pop($closingTokens[$level])) {
$tokens[] = $token;
}
}
} while ($level > 0);
return $tokens;
}
}

View file

@ -0,0 +1,148 @@
<?php
/**
* Defines common attribute collections that modules reference
*/
class HTMLPurifier_AttrCollections
{
/**
* Associative array of attribute collections, indexed by name.
* @type array
*/
public $info = array();
/**
* Performs all expansions on internal data for use by other inclusions
* It also collects all attribute collection extensions from
* modules
* @param HTMLPurifier_AttrTypes $attr_types HTMLPurifier_AttrTypes instance
* @param HTMLPurifier_HTMLModule[] $modules Hash array of HTMLPurifier_HTMLModule members
*/
public function __construct($attr_types, $modules)
{
$this->doConstruct($attr_types, $modules);
}
public function doConstruct($attr_types, $modules)
{
// load extensions from the modules
foreach ($modules as $module) {
foreach ($module->attr_collections as $coll_i => $coll) {
if (!isset($this->info[$coll_i])) {
$this->info[$coll_i] = array();
}
foreach ($coll as $attr_i => $attr) {
if ($attr_i === 0 && isset($this->info[$coll_i][$attr_i])) {
// merge in includes
$this->info[$coll_i][$attr_i] = array_merge(
$this->info[$coll_i][$attr_i],
$attr
);
continue;
}
$this->info[$coll_i][$attr_i] = $attr;
}
}
}
// perform internal expansions and inclusions
foreach ($this->info as $name => $attr) {
// merge attribute collections that include others
$this->performInclusions($this->info[$name]);
// replace string identifiers with actual attribute objects
$this->expandIdentifiers($this->info[$name], $attr_types);
}
}
/**
* Takes a reference to an attribute associative array and performs
* all inclusions specified by the zero index.
* @param array &$attr Reference to attribute array
*/
public function performInclusions(&$attr)
{
if (!isset($attr[0])) {
return;
}
$merge = $attr[0];
$seen = array(); // recursion guard
// loop through all the inclusions
for ($i = 0; isset($merge[$i]); $i++) {
if (isset($seen[$merge[$i]])) {
continue;
}
$seen[$merge[$i]] = true;
// foreach attribute of the inclusion, copy it over
if (!isset($this->info[$merge[$i]])) {
continue;
}
foreach ($this->info[$merge[$i]] as $key => $value) {
if (isset($attr[$key])) {
continue;
} // also catches more inclusions
$attr[$key] = $value;
}
if (isset($this->info[$merge[$i]][0])) {
// recursion
$merge = array_merge($merge, $this->info[$merge[$i]][0]);
}
}
unset($attr[0]);
}
/**
* Expands all string identifiers in an attribute array by replacing
* them with the appropriate values inside HTMLPurifier_AttrTypes
* @param array &$attr Reference to attribute array
* @param HTMLPurifier_AttrTypes $attr_types HTMLPurifier_AttrTypes instance
*/
public function expandIdentifiers(&$attr, $attr_types)
{
// because foreach will process new elements we add, make sure we
// skip duplicates
$processed = array();
foreach ($attr as $def_i => $def) {
// skip inclusions
if ($def_i === 0) {
continue;
}
if (isset($processed[$def_i])) {
continue;
}
// determine whether or not attribute is required
if ($required = (strpos($def_i, '*') !== false)) {
// rename the definition
unset($attr[$def_i]);
$def_i = trim($def_i, '*');
$attr[$def_i] = $def;
}
$processed[$def_i] = true;
// if we've already got a literal object, move on
if (is_object($def)) {
// preserve previous required
$attr[$def_i]->required = ($required || $attr[$def_i]->required);
continue;
}
if ($def === false) {
unset($attr[$def_i]);
continue;
}
if ($t = $attr_types->get($def)) {
$attr[$def_i] = $t;
$attr[$def_i]->required = $required;
} else {
unset($attr[$def_i]);
}
}
}
}
// vim: et sw=4 sts=4

View file

@ -0,0 +1,144 @@
<?php
/**
* Base class for all validating attribute definitions.
*
* This family of classes forms the core for not only HTML attribute validation,
* but also any sort of string that needs to be validated or cleaned (which
* means CSS properties and composite definitions are defined here too).
* Besides defining (through code) what precisely makes the string valid,
* subclasses are also responsible for cleaning the code if possible.
*/
abstract class HTMLPurifier_AttrDef
{
/**
* Tells us whether or not an HTML attribute is minimized.
* Has no meaning in other contexts.
* @type bool
*/
public $minimized = false;
/**
* Tells us whether or not an HTML attribute is required.
* Has no meaning in other contexts
* @type bool
*/
public $required = false;
/**
* Validates and cleans passed string according to a definition.
*
* @param string $string String to be validated and cleaned.
* @param HTMLPurifier_Config $config Mandatory HTMLPurifier_Config object.
* @param HTMLPurifier_Context $context Mandatory HTMLPurifier_Context object.
*/
abstract public function validate($string, $config, $context);
/**
* Convenience method that parses a string as if it were CDATA.
*
* This method process a string in the manner specified at
* <http://www.w3.org/TR/html4/types.html#h-6.2> by removing
* leading and trailing whitespace, ignoring line feeds, and replacing
* carriage returns and tabs with spaces. While most useful for HTML
* attributes specified as CDATA, it can also be applied to most CSS
* values.
*
* @note This method is not entirely standards compliant, as trim() removes
* more types of whitespace than specified in the spec. In practice,
* this is rarely a problem, as those extra characters usually have
* already been removed by HTMLPurifier_Encoder.
*
* @warning This processing is inconsistent with XML's whitespace handling
* as specified by section 3.3.3 and referenced XHTML 1.0 section
* 4.7. However, note that we are NOT necessarily
* parsing XML, thus, this behavior may still be correct. We
* assume that newlines have been normalized.
*/
public function parseCDATA($string)
{
$string = trim($string);
$string = str_replace(array("\n", "\t", "\r"), ' ', $string);
return $string;
}
/**
* Factory method for creating this class from a string.
* @param string $string String construction info
* @return HTMLPurifier_AttrDef Created AttrDef object corresponding to $string
*/
public function make($string)
{
// default implementation, return a flyweight of this object.
// If $string has an effect on the returned object (i.e. you
// need to overload this method), it is best
// to clone or instantiate new copies. (Instantiation is safer.)
return $this;
}
/**
* Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work
* properly. THIS IS A HACK!
* @param string $string a CSS colour definition
* @return string
*/
protected function mungeRgb($string)
{
$p = '\s*(\d+(\.\d+)?([%]?))\s*';
if (preg_match('/(rgba|hsla)\(/', $string)) {
return preg_replace('/(rgba|hsla)\('.$p.','.$p.','.$p.','.$p.'\)/', '\1(\2,\5,\8,\11)', $string);
}
return preg_replace('/(rgb|hsl)\('.$p.','.$p.','.$p.'\)/', '\1(\2,\5,\8)', $string);
}
/**
* Parses a possibly escaped CSS string and returns the "pure"
* version of it.
*/
protected function expandCSSEscape($string)
{
// flexibly parse it
$ret = '';
for ($i = 0, $c = strlen($string); $i < $c; $i++) {
if ($string[$i] === '\\') {
$i++;
if ($i >= $c) {
$ret .= '\\';
break;
}
if (ctype_xdigit($string[$i])) {
$code = $string[$i];
for ($a = 1, $i++; $i < $c && $a < 6; $i++, $a++) {
if (!ctype_xdigit($string[$i])) {
break;
}
$code .= $string[$i];
}
// We have to be extremely careful when adding
// new characters, to make sure we're not breaking
// the encoding.
$char = HTMLPurifier_Encoder::unichr(hexdec($code));
if (HTMLPurifier_Encoder::cleanUTF8($char) === '') {
continue;
}
$ret .= $char;
if ($i < $c && trim($string[$i]) !== '') {
$i--;
}
continue;
}
if ($string[$i] === "\n") {
continue;
}
}
$ret .= $string[$i];
}
return $ret;
}
}
// vim: et sw=4 sts=4

View file

@ -0,0 +1,136 @@
<?php
/**
* Validates the HTML attribute style, otherwise known as CSS.
* @note We don't implement the whole CSS specification, so it might be
* difficult to reuse this component in the context of validating
* actual stylesheet declarations.
* @note If we were really serious about validating the CSS, we would
* tokenize the styles and then parse the tokens. Obviously, we
* are not doing that. Doing that could seriously harm performance,
* but would make these components a lot more viable for a CSS
* filtering solution.
*/
class HTMLPurifier_AttrDef_CSS extends HTMLPurifier_AttrDef
{
/**
* @param string $css
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return bool|string
*/
public function validate($css, $config, $context)
{
$css = $this->parseCDATA($css);
$definition = $config->getCSSDefinition();
$allow_duplicates = $config->get("CSS.AllowDuplicates");
// According to the CSS2.1 spec, the places where a
// non-delimiting semicolon can appear are in strings
// escape sequences. So here is some dumb hack to
// handle quotes.
$len = strlen($css);
$accum = "";
$declarations = array();
$quoted = false;
for ($i = 0; $i < $len; $i++) {
$c = strcspn($css, ";'\"", $i);
$accum .= substr($css, $i, $c);
$i += $c;
if ($i == $len) break;
$d = $css[$i];
if ($quoted) {
$accum .= $d;
if ($d == $quoted) {
$quoted = false;
}
} else {
if ($d == ";") {
$declarations[] = $accum;
$accum = "";
} else {
$accum .= $d;
$quoted = $d;
}
}
}
if ($accum != "") $declarations[] = $accum;
$propvalues = array();
$new_declarations = '';
/**
* Name of the current CSS property being validated.
*/
$property = false;
$context->register('CurrentCSSProperty', $property);
foreach ($declarations as $declaration) {
if (!$declaration) {
continue;
}
if (!strpos($declaration, ':')) {
continue;
}
list($property, $value) = explode(':', $declaration, 2);
$property = trim($property);
$value = trim($value);
$ok = false;
do {
if (isset($definition->info[$property])) {
$ok = true;
break;
}
if (ctype_lower($property)) {
break;
}
$property = strtolower($property);
if (isset($definition->info[$property])) {
$ok = true;
break;
}
} while (0);
if (!$ok) {
continue;
}
// inefficient call, since the validator will do this again
if (strtolower(trim($value)) !== 'inherit') {
// inherit works for everything (but only on the base property)
$result = $definition->info[$property]->validate(
$value,
$config,
$context
);
} else {
$result = 'inherit';
}
if ($result === false) {
continue;
}
if ($allow_duplicates) {
$new_declarations .= "$property:$result;";
} else {
$propvalues[$property] = $result;
}
}
$context->destroy('CurrentCSSProperty');
// procedure does not write the new CSS simultaneously, so it's
// slightly inefficient, but it's the only way of getting rid of
// duplicates. Perhaps config to optimize it, but not now.
foreach ($propvalues as $prop => $value) {
$new_declarations .= "$prop:$value;";
}
return $new_declarations ? $new_declarations : false;
}
}
// vim: et sw=4 sts=4

Some files were not shown because too many files have changed in this diff Show more