aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/3rdparty/libraries/send2kindle/utils.php
diff options
context:
space:
mode:
authortcit <tcit@tcit.fr>2014-07-24 15:49:36 +0200
committertcit <tcit@tcit.fr>2014-07-24 15:49:36 +0200
commit4188f38ad56d7ba2ea46e94403f305243514f80c (patch)
treef357ddbd0d846ebae0ecf5d2ab00d6b7dd6eb8d5 /inc/3rdparty/libraries/send2kindle/utils.php
parent2b58426b2d4a7f1585d5d7667c0a4fbea4cd29dd (diff)
downloadwallabag-4188f38ad56d7ba2ea46e94403f305243514f80c.tar.gz
wallabag-4188f38ad56d7ba2ea46e94403f305243514f80c.tar.zst
wallabag-4188f38ad56d7ba2ea46e94403f305243514f80c.zip
add pdf and mobi libraries
Diffstat (limited to 'inc/3rdparty/libraries/send2kindle/utils.php')
-rw-r--r--inc/3rdparty/libraries/send2kindle/utils.php37
1 files changed, 37 insertions, 0 deletions
diff --git a/inc/3rdparty/libraries/send2kindle/utils.php b/inc/3rdparty/libraries/send2kindle/utils.php
new file mode 100644
index 00000000..87cc3de0
--- /dev/null
+++ b/inc/3rdparty/libraries/send2kindle/utils.php
@@ -0,0 +1,37 @@
1<?php
2/**
3 * Utils for news2kindle
4 * @author jwest <jwest@jwest.pl>
5 */
6class Utils
7{
8 /**
9 * URL encode
10 * @param string $url
11 * @return string $ar_url
12 */
13 public static function urlencode( $url )
14 {
15 $ar_url = explode( '/', $url );
16
17 foreach ( $ar_url as $key => $val )
18 {
19 $ar_url[ $key ] = urlencode( $val );
20 }
21
22 return implode('/', $ar_url );
23 }
24
25 /**
26 * Prepare ID for google rss article
27 * @param string $id
28 * @return string
29 */
30 public static function prepare_id($id)
31 {
32 $char_in = array('/', '.', ',', ':');
33 $id = str_replace($char_in, '-', $id);
34
35 return $id;
36 }
37} \ No newline at end of file