aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag
diff options
context:
space:
mode:
authorJeremy <jeremy.benoist@gmail.com>2015-01-31 19:09:34 +0100
committerJeremy <jeremy.benoist@gmail.com>2015-01-31 19:12:49 +0100
commit7df80cb32ca9b7d0fe452320ddc3563a1e373e2f (patch)
treec07eb79213d471aa33c49ef4e5819e41cc12f242 /src/Wallabag
parent1990517b2263a080946853ed697a6d687262ae80 (diff)
downloadwallabag-7df80cb32ca9b7d0fe452320ddc3563a1e373e2f.tar.gz
wallabag-7df80cb32ca9b7d0fe452320ddc3563a1e373e2f.tar.zst
wallabag-7df80cb32ca9b7d0fe452320ddc3563a1e373e2f.zip
CS
Diffstat (limited to 'src/Wallabag')
-rw-r--r--src/Wallabag/CoreBundle/Controller/EntryController.php19
-rw-r--r--src/Wallabag/CoreBundle/Controller/SecurityController.php3
-rw-r--r--src/Wallabag/CoreBundle/Controller/WallabagRestController.php30
-rw-r--r--src/Wallabag/CoreBundle/DependencyInjection/Security/Factory/WsseFactory.php2
-rw-r--r--src/Wallabag/CoreBundle/Entity/Config.php12
-rw-r--r--src/Wallabag/CoreBundle/Entity/Entries.php29
-rw-r--r--src/Wallabag/CoreBundle/Entity/Tags.php8
-rw-r--r--src/Wallabag/CoreBundle/Entity/TagsEntries.php12
-rw-r--r--src/Wallabag/CoreBundle/Entity/Users.php21
-rw-r--r--src/Wallabag/CoreBundle/Entity/UsersConfig.php16
-rw-r--r--src/Wallabag/CoreBundle/Helper/Content.php6
-rw-r--r--src/Wallabag/CoreBundle/Helper/Entries.php9
-rwxr-xr-xsrc/Wallabag/CoreBundle/Helper/Tools.php37
-rw-r--r--src/Wallabag/CoreBundle/Helper/Url.php15
-rw-r--r--src/Wallabag/CoreBundle/Repository/EntriesRepository.php7
-rw-r--r--src/Wallabag/CoreBundle/Resources/config/routing.yml2
-rw-r--r--src/Wallabag/CoreBundle/Resources/config/routing_rest.yml2
-rw-r--r--src/Wallabag/CoreBundle/Resources/config/services.xml2
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/Entry/entry.html.twig2
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/Entry/new.html.twig2
-rwxr-xr-xsrc/Wallabag/CoreBundle/Resources/views/Static/about.html.twig4
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/_bookmarklet.html.twig2
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/_footer.html.twig2
-rwxr-xr-xsrc/Wallabag/CoreBundle/Resources/views/_head.html.twig1
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/_menu.html.twig1
-rwxr-xr-xsrc/Wallabag/CoreBundle/Resources/views/baggy/config.twig2
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/baggy/layout-login.twig2
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/baggy/login.twig2
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/default/_bookmarklet.twig2
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/default/_footer.twig2
-rwxr-xr-xsrc/Wallabag/CoreBundle/Resources/views/default/_import.twig2
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/default/_menu.twig1
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/default/_messages.twig2
-rwxr-xr-xsrc/Wallabag/CoreBundle/Resources/views/default/_search-form.twig2
-rwxr-xr-xsrc/Wallabag/CoreBundle/Resources/views/default/about.twig2
-rwxr-xr-xsrc/Wallabag/CoreBundle/Resources/views/default/config.twig2
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/default/export.twig2
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/default/layout.twig2
-rwxr-xr-xsrc/Wallabag/CoreBundle/Resources/views/default/tags.twig2
-rwxr-xr-xsrc/Wallabag/CoreBundle/Resources/views/default/view.twig20
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/layout-login.html.twig2
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/layout.html.twig2
-rw-r--r--src/Wallabag/CoreBundle/Security/Authentication/Provider/WsseProvider.php2
-rw-r--r--src/Wallabag/CoreBundle/Security/Authentication/Token/WsseUserToken.php2
-rw-r--r--src/Wallabag/CoreBundle/Security/Firewall/WsseListener.php3
-rw-r--r--src/Wallabag/CoreBundle/Service/Extractor.php30
-rw-r--r--src/Wallabag/CoreBundle/Twig/Extension/WallabagExtension.php2
47 files changed, 153 insertions, 183 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php
index 25f18711..377a45ae 100644
--- a/src/Wallabag/CoreBundle/Controller/EntryController.php
+++ b/src/Wallabag/CoreBundle/Controller/EntryController.php
@@ -8,14 +8,12 @@ use Symfony\Component\HttpFoundation\Request;
8use Wallabag\CoreBundle\Repository; 8use Wallabag\CoreBundle\Repository;
9use Wallabag\CoreBundle\Entity\Entries; 9use Wallabag\CoreBundle\Entity\Entries;
10use Wallabag\CoreBundle\Service\Extractor; 10use Wallabag\CoreBundle\Service\Extractor;
11use Wallabag\CoreBundle\Helper\Tools;
12use Wallabag\CoreBundle\Helper\Url; 11use Wallabag\CoreBundle\Helper\Url;
13 12
14class EntryController extends Controller 13class EntryController extends Controller
15{ 14{
16
17 /** 15 /**
18 * @param Request $request 16 * @param Request $request
19 * @Route("/new", name="new_entry") 17 * @Route("/new", name="new_entry")
20 * @return \Symfony\Component\HttpFoundation\Response 18 * @return \Symfony\Component\HttpFoundation\Response
21 */ 19 */
@@ -32,7 +30,6 @@ class EntryController extends Controller
32 $form->handleRequest($request); 30 $form->handleRequest($request);
33 31
34 if ($form->isValid()) { 32 if ($form->isValid()) {
35
36 $content = Extractor::extract($entry->getUrl()); 33 $content = Extractor::extract($entry->getUrl());
37 34
38 $entry->setTitle($content->getTitle()); 35 $entry->setTitle($content->getTitle());
@@ -115,7 +112,7 @@ class EntryController extends Controller
115 /** 112 /**
116 * Shows entry content 113 * Shows entry content
117 * 114 *
118 * @param Entries $entry 115 * @param Entries $entry
119 * @Route("/view/{id}", requirements={"id" = "\d+"}, name="view") 116 * @Route("/view/{id}", requirements={"id" = "\d+"}, name="view")
120 * @return \Symfony\Component\HttpFoundation\Response 117 * @return \Symfony\Component\HttpFoundation\Response
121 */ 118 */
@@ -130,8 +127,8 @@ class EntryController extends Controller
130 /** 127 /**
131 * Changes read status for an entry 128 * Changes read status for an entry
132 * 129 *
133 * @param Request $request 130 * @param Request $request
134 * @param Entries $entry 131 * @param Entries $entry
135 * @Route("/archive/{id}", requirements={"id" = "\d+"}, name="archive_entry") 132 * @Route("/archive/{id}", requirements={"id" = "\d+"}, name="archive_entry")
136 * @return \Symfony\Component\HttpFoundation\RedirectResponse 133 * @return \Symfony\Component\HttpFoundation\RedirectResponse
137 */ 134 */
@@ -151,8 +148,8 @@ class EntryController extends Controller
151 /** 148 /**
152 * Changes favorite status for an entry 149 * Changes favorite status for an entry
153 * 150 *
154 * @param Request $request 151 * @param Request $request
155 * @param Entries $entry 152 * @param Entries $entry
156 * @Route("/star/{id}", requirements={"id" = "\d+"}, name="star_entry") 153 * @Route("/star/{id}", requirements={"id" = "\d+"}, name="star_entry")
157 * @return \Symfony\Component\HttpFoundation\RedirectResponse 154 * @return \Symfony\Component\HttpFoundation\RedirectResponse
158 */ 155 */
@@ -172,8 +169,8 @@ class EntryController extends Controller
172 /** 169 /**
173 * Deletes entry 170 * Deletes entry
174 * 171 *
175 * @param Request $request 172 * @param Request $request
176 * @param Entries $entry 173 * @param Entries $entry
177 * @Route("/delete/{id}", requirements={"id" = "\d+"}, name="delete_entry") 174 * @Route("/delete/{id}", requirements={"id" = "\d+"}, name="delete_entry")
178 * @return \Symfony\Component\HttpFoundation\RedirectResponse 175 * @return \Symfony\Component\HttpFoundation\RedirectResponse
179 */ 176 */
diff --git a/src/Wallabag/CoreBundle/Controller/SecurityController.php b/src/Wallabag/CoreBundle/Controller/SecurityController.php
index 51f9cc26..c2901da2 100644
--- a/src/Wallabag/CoreBundle/Controller/SecurityController.php
+++ b/src/Wallabag/CoreBundle/Controller/SecurityController.php
@@ -18,10 +18,11 @@ class SecurityController extends Controller
18 $error = $session->get(SecurityContext::AUTHENTICATION_ERROR); 18 $error = $session->get(SecurityContext::AUTHENTICATION_ERROR);
19 $session->remove(SecurityContext::AUTHENTICATION_ERROR); 19 $session->remove(SecurityContext::AUTHENTICATION_ERROR);
20 } 20 }
21
21 return $this->render('WallabagCoreBundle:Security:login.html.twig', array( 22 return $this->render('WallabagCoreBundle:Security:login.html.twig', array(
22 // last username entered by the user 23 // last username entered by the user
23 'last_username' => $session->get(SecurityContext::LAST_USERNAME), 24 'last_username' => $session->get(SecurityContext::LAST_USERNAME),
24 'error' => $error, 25 'error' => $error,
25 )); 26 ));
26 } 27 }
27} \ No newline at end of file 28}
diff --git a/src/Wallabag/CoreBundle/Controller/WallabagRestController.php b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php
index 8e018e88..5668d934 100644
--- a/src/Wallabag/CoreBundle/Controller/WallabagRestController.php
+++ b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php
@@ -3,7 +3,6 @@
3namespace Wallabag\CoreBundle\Controller; 3namespace Wallabag\CoreBundle\Controller;
4 4
5use Nelmio\ApiDocBundle\Annotation\ApiDoc; 5use Nelmio\ApiDocBundle\Annotation\ApiDoc;
6use FOS\RestBundle\Controller\Annotations\View;
7use Symfony\Bundle\FrameworkBundle\Controller\Controller; 6use Symfony\Bundle\FrameworkBundle\Controller\Controller;
8use Symfony\Component\HttpFoundation\Request; 7use Symfony\Component\HttpFoundation\Request;
9use Wallabag\CoreBundle\Entity\Entries; 8use Wallabag\CoreBundle\Entity\Entries;
@@ -12,7 +11,6 @@ use Wallabag\CoreBundle\Service\Extractor;
12 11
13class WallabagRestController extends Controller 12class WallabagRestController extends Controller
14{ 13{
15
16 /** 14 /**
17 * Retrieve all entries. It could be filtered by many options. 15 * Retrieve all entries. It could be filtered by many options.
18 * 16 *
@@ -44,14 +42,13 @@ class WallabagRestController extends Controller
44 $entries = $this 42 $entries = $this
45 ->getDoctrine() 43 ->getDoctrine()
46 ->getRepository('WallabagCoreBundle:Entries') 44 ->getRepository('WallabagCoreBundle:Entries')
47 ->findEntries(1, (int)$isArchived, (int)$isStarred, (int)$isDeleted, $sort, $order); 45 ->findEntries(1, (int) $isArchived, (int) $isStarred, (int) $isDeleted, $sort, $order);
48 46
49 if(!is_array($entries)) { 47 if (!is_array($entries)) {
50 throw $this->createNotFoundException(); 48 throw $this->createNotFoundException();
51 } 49 }
52 50
53 return $entries; 51 return $entries;
54
55 } 52 }
56 53
57 /** 54 /**
@@ -119,7 +116,6 @@ class WallabagRestController extends Controller
119 */ 116 */
120 public function patchEntriesAction(Entries $entry) 117 public function patchEntriesAction(Entries $entry)
121 { 118 {
122
123 } 119 }
124 120
125 /** 121 /**
@@ -133,10 +129,8 @@ class WallabagRestController extends Controller
133 */ 129 */
134 public function deleteEntriesAction(Entries $entry) 130 public function deleteEntriesAction(Entries $entry)
135 { 131 {
136
137 } 132 }
138 133
139
140 /** 134 /**
141 * Retrieve all tags for an entry 135 * Retrieve all tags for an entry
142 * 136 *
@@ -146,8 +140,8 @@ class WallabagRestController extends Controller
146 * } 140 * }
147 * ) 141 * )
148 */ 142 */
149 public function getEntriesTagsAction(Entries $entry) { 143 public function getEntriesTagsAction(Entries $entry)
150 144 {
151 } 145 }
152 146
153 /** 147 /**
@@ -162,8 +156,8 @@ class WallabagRestController extends Controller
162 * } 156 * }
163 * ) 157 * )
164 */ 158 */
165 public function postEntriesTagsAction(Entries $entry) { 159 public function postEntriesTagsAction(Entries $entry)
166 160 {
167 } 161 }
168 162
169 /** 163 /**
@@ -178,7 +172,6 @@ class WallabagRestController extends Controller
178 */ 172 */
179 public function deleteEntriesTagsAction(Entries $entry, Tags $tag) 173 public function deleteEntriesTagsAction(Entries $entry, Tags $tag)
180 { 174 {
181
182 } 175 }
183 176
184 /** 177 /**
@@ -187,8 +180,8 @@ class WallabagRestController extends Controller
187 * @ApiDoc( 180 * @ApiDoc(
188 * ) 181 * )
189 */ 182 */
190 public function getTagsAction() { 183 public function getTagsAction()
191 184 {
192 } 185 }
193 186
194 /** 187 /**
@@ -200,8 +193,8 @@ class WallabagRestController extends Controller
200 * } 193 * }
201 * ) 194 * )
202 */ 195 */
203 public function getTagAction(Tags $tag) { 196 public function getTagAction(Tags $tag)
204 197 {
205 } 198 }
206 199
207 /** 200 /**
@@ -215,6 +208,5 @@ class WallabagRestController extends Controller
215 */ 208 */
216 public function deleteTagAction(Tags $tag) 209 public function deleteTagAction(Tags $tag)
217 { 210 {
218
219 } 211 }
220} \ No newline at end of file 212}
diff --git a/src/Wallabag/CoreBundle/DependencyInjection/Security/Factory/WsseFactory.php b/src/Wallabag/CoreBundle/DependencyInjection/Security/Factory/WsseFactory.php
index 9807fe9a..0b5bdb40 100644
--- a/src/Wallabag/CoreBundle/DependencyInjection/Security/Factory/WsseFactory.php
+++ b/src/Wallabag/CoreBundle/DependencyInjection/Security/Factory/WsseFactory.php
@@ -37,4 +37,4 @@ class WsseFactory implements SecurityFactoryInterface
37 public function addConfiguration(NodeDefinition $node) 37 public function addConfiguration(NodeDefinition $node)
38 { 38 {
39 } 39 }
40} \ No newline at end of file 40}
diff --git a/src/Wallabag/CoreBundle/Entity/Config.php b/src/Wallabag/CoreBundle/Entity/Config.php
index d60b2df0..045ca308 100644
--- a/src/Wallabag/CoreBundle/Entity/Config.php
+++ b/src/Wallabag/CoreBundle/Entity/Config.php
@@ -35,12 +35,10 @@ class Config
35 */ 35 */
36 private $value; 36 private $value;
37 37
38
39
40 /** 38 /**
41 * Get id 39 * Get id
42 * 40 *
43 * @return integer 41 * @return integer
44 */ 42 */
45 public function getId() 43 public function getId()
46 { 44 {
@@ -50,7 +48,7 @@ class Config
50 /** 48 /**
51 * Set name 49 * Set name
52 * 50 *
53 * @param string $name 51 * @param string $name
54 * @return Config 52 * @return Config
55 */ 53 */
56 public function setName($name) 54 public function setName($name)
@@ -63,7 +61,7 @@ class Config
63 /** 61 /**
64 * Get name 62 * Get name
65 * 63 *
66 * @return string 64 * @return string
67 */ 65 */
68 public function getName() 66 public function getName()
69 { 67 {
@@ -73,7 +71,7 @@ class Config
73 /** 71 /**
74 * Set value 72 * Set value
75 * 73 *
76 * @param string $value 74 * @param string $value
77 * @return Config 75 * @return Config
78 */ 76 */
79 public function setValue($value) 77 public function setValue($value)
@@ -86,7 +84,7 @@ class Config
86 /** 84 /**
87 * Get value 85 * Get value
88 * 86 *
89 * @return string 87 * @return string
90 */ 88 */
91 public function getValue() 89 public function getValue()
92 { 90 {
diff --git a/src/Wallabag/CoreBundle/Entity/Entries.php b/src/Wallabag/CoreBundle/Entity/Entries.php
index 3c061a37..9da5102c 100644
--- a/src/Wallabag/CoreBundle/Entity/Entries.php
+++ b/src/Wallabag/CoreBundle/Entity/Entries.php
@@ -66,12 +66,10 @@ class Entries
66 */ 66 */
67 private $userId; 67 private $userId;
68 68
69
70
71 /** 69 /**
72 * Get id 70 * Get id
73 * 71 *
74 * @return integer 72 * @return integer
75 */ 73 */
76 public function getId() 74 public function getId()
77 { 75 {
@@ -81,7 +79,7 @@ class Entries
81 /** 79 /**
82 * Set title 80 * Set title
83 * 81 *
84 * @param string $title 82 * @param string $title
85 * @return Entries 83 * @return Entries
86 */ 84 */
87 public function setTitle($title) 85 public function setTitle($title)
@@ -94,7 +92,7 @@ class Entries
94 /** 92 /**
95 * Get title 93 * Get title
96 * 94 *
97 * @return string 95 * @return string
98 */ 96 */
99 public function getTitle() 97 public function getTitle()
100 { 98 {
@@ -104,7 +102,7 @@ class Entries
104 /** 102 /**
105 * Set url 103 * Set url
106 * 104 *
107 * @param string $url 105 * @param string $url
108 * @return Entries 106 * @return Entries
109 */ 107 */
110 public function setUrl($url) 108 public function setUrl($url)
@@ -117,7 +115,7 @@ class Entries
117 /** 115 /**
118 * Get url 116 * Get url
119 * 117 *
120 * @return string 118 * @return string
121 */ 119 */
122 public function getUrl() 120 public function getUrl()
123 { 121 {
@@ -127,7 +125,7 @@ class Entries
127 /** 125 /**
128 * Set isRead 126 * Set isRead
129 * 127 *
130 * @param string $isRead 128 * @param string $isRead
131 * @return Entries 129 * @return Entries
132 */ 130 */
133 public function setIsRead($isRead) 131 public function setIsRead($isRead)
@@ -140,7 +138,7 @@ class Entries
140 /** 138 /**
141 * Get isRead 139 * Get isRead
142 * 140 *
143 * @return string 141 * @return string
144 */ 142 */
145 public function getIsRead() 143 public function getIsRead()
146 { 144 {
@@ -150,13 +148,14 @@ class Entries
150 public function toggleArchive() 148 public function toggleArchive()
151 { 149 {
152 $this->isRead = $this->getIsRead() ^ 1; 150 $this->isRead = $this->getIsRead() ^ 1;
151
153 return $this; 152 return $this;
154 } 153 }
155 154
156 /** 155 /**
157 * Set isFav 156 * Set isFav
158 * 157 *
159 * @param string $isFav 158 * @param string $isFav
160 * @return Entries 159 * @return Entries
161 */ 160 */
162 public function setIsFav($isFav) 161 public function setIsFav($isFav)
@@ -169,7 +168,7 @@ class Entries
169 /** 168 /**
170 * Get isFav 169 * Get isFav
171 * 170 *
172 * @return string 171 * @return string
173 */ 172 */
174 public function getIsFav() 173 public function getIsFav()
175 { 174 {
@@ -186,7 +185,7 @@ class Entries
186 /** 185 /**
187 * Set content 186 * Set content
188 * 187 *
189 * @param string $content 188 * @param string $content
190 * @return Entries 189 * @return Entries
191 */ 190 */
192 public function setContent($content) 191 public function setContent($content)
@@ -199,7 +198,7 @@ class Entries
199 /** 198 /**
200 * Get content 199 * Get content
201 * 200 *
202 * @return string 201 * @return string
203 */ 202 */
204 public function getContent() 203 public function getContent()
205 { 204 {
@@ -209,7 +208,7 @@ class Entries
209 /** 208 /**
210 * Set userId 209 * Set userId
211 * 210 *
212 * @param string $userId 211 * @param string $userId
213 * @return Entries 212 * @return Entries
214 */ 213 */
215 public function setUserId($userId) 214 public function setUserId($userId)
@@ -222,7 +221,7 @@ class Entries
222 /** 221 /**
223 * Get userId 222 * Get userId
224 * 223 *
225 * @return string 224 * @return string
226 */ 225 */
227 public function getUserId() 226 public function getUserId()
228 { 227 {
diff --git a/src/Wallabag/CoreBundle/Entity/Tags.php b/src/Wallabag/CoreBundle/Entity/Tags.php
index 6fe16a53..eab91ba0 100644
--- a/src/Wallabag/CoreBundle/Entity/Tags.php
+++ b/src/Wallabag/CoreBundle/Entity/Tags.php
@@ -28,12 +28,10 @@ class Tags
28 */ 28 */
29 private $value; 29 private $value;
30 30
31
32
33 /** 31 /**
34 * Get id 32 * Get id
35 * 33 *
36 * @return integer 34 * @return integer
37 */ 35 */
38 public function getId() 36 public function getId()
39 { 37 {
@@ -43,7 +41,7 @@ class Tags
43 /** 41 /**
44 * Set value 42 * Set value
45 * 43 *
46 * @param string $value 44 * @param string $value
47 * @return Tags 45 * @return Tags
48 */ 46 */
49 public function setValue($value) 47 public function setValue($value)
@@ -56,7 +54,7 @@ class Tags
56 /** 54 /**
57 * Get value 55 * Get value
58 * 56 *
59 * @return string 57 * @return string
60 */ 58 */
61 public function getValue() 59 public function getValue()
62 { 60 {
diff --git a/src/Wallabag/CoreBundle/Entity/TagsEntries.php b/src/Wallabag/CoreBundle/Entity/TagsEntries.php
index ad01cf57..6b0cea0d 100644
--- a/src/Wallabag/CoreBundle/Entity/TagsEntries.php
+++ b/src/Wallabag/CoreBundle/Entity/TagsEntries.php
@@ -35,12 +35,10 @@ class TagsEntries
35 */ 35 */
36 private $tagId; 36 private $tagId;
37 37
38
39
40 /** 38 /**
41 * Get id 39 * Get id
42 * 40 *
43 * @return integer 41 * @return integer
44 */ 42 */
45 public function getId() 43 public function getId()
46 { 44 {
@@ -50,7 +48,7 @@ class TagsEntries
50 /** 48 /**
51 * Set entryId 49 * Set entryId
52 * 50 *
53 * @param integer $entryId 51 * @param integer $entryId
54 * @return TagsEntries 52 * @return TagsEntries
55 */ 53 */
56 public function setEntryId($entryId) 54 public function setEntryId($entryId)
@@ -63,7 +61,7 @@ class TagsEntries
63 /** 61 /**
64 * Get entryId 62 * Get entryId
65 * 63 *
66 * @return integer 64 * @return integer
67 */ 65 */
68 public function getEntryId() 66 public function getEntryId()
69 { 67 {
@@ -73,7 +71,7 @@ class TagsEntries
73 /** 71 /**
74 * Set tagId 72 * Set tagId
75 * 73 *
76 * @param integer $tagId 74 * @param integer $tagId
77 * @return TagsEntries 75 * @return TagsEntries
78 */ 76 */
79 public function setTagId($tagId) 77 public function setTagId($tagId)
@@ -86,7 +84,7 @@ class TagsEntries
86 /** 84 /**
87 * Get tagId 85 * Get tagId
88 * 86 *
89 * @return integer 87 * @return integer
90 */ 88 */
91 public function getTagId() 89 public function getTagId()
92 { 90 {
diff --git a/src/Wallabag/CoreBundle/Entity/Users.php b/src/Wallabag/CoreBundle/Entity/Users.php
index 96867bd6..e0b1fb39 100644
--- a/src/Wallabag/CoreBundle/Entity/Users.php
+++ b/src/Wallabag/CoreBundle/Entity/Users.php
@@ -4,7 +4,6 @@ namespace Wallabag\CoreBundle\Entity;
4 4
5use Doctrine\ORM\Mapping as ORM; 5use Doctrine\ORM\Mapping as ORM;
6use Symfony\Component\Security\Core\User\UserInterface; 6use Symfony\Component\Security\Core\User\UserInterface;
7use Symfony\Component\Security\Core\User\EquatableInterface;
8use Symfony\Component\Security\Core\User\AdvancedUserInterface; 7use Symfony\Component\Security\Core\User\AdvancedUserInterface;
9 8
10/** 9/**
@@ -71,7 +70,7 @@ class Users implements AdvancedUserInterface, \Serializable
71 /** 70 /**
72 * Get id 71 * Get id
73 * 72 *
74 * @return integer 73 * @return integer
75 */ 74 */
76 public function getId() 75 public function getId()
77 { 76 {
@@ -81,7 +80,7 @@ class Users implements AdvancedUserInterface, \Serializable
81 /** 80 /**
82 * Set username 81 * Set username
83 * 82 *
84 * @param string $username 83 * @param string $username
85 * @return Users 84 * @return Users
86 */ 85 */
87 public function setUsername($username) 86 public function setUsername($username)
@@ -94,7 +93,7 @@ class Users implements AdvancedUserInterface, \Serializable
94 /** 93 /**
95 * Get username 94 * Get username
96 * 95 *
97 * @return string 96 * @return string
98 */ 97 */
99 public function getUsername() 98 public function getUsername()
100 { 99 {
@@ -120,7 +119,7 @@ class Users implements AdvancedUserInterface, \Serializable
120 /** 119 /**
121 * Set password 120 * Set password
122 * 121 *
123 * @param string $password 122 * @param string $password
124 * @return Users 123 * @return Users
125 */ 124 */
126 public function setPassword($password) 125 public function setPassword($password)
@@ -133,7 +132,7 @@ class Users implements AdvancedUserInterface, \Serializable
133 /** 132 /**
134 * Get password 133 * Get password
135 * 134 *
136 * @return string 135 * @return string
137 */ 136 */
138 public function getPassword() 137 public function getPassword()
139 { 138 {
@@ -143,7 +142,7 @@ class Users implements AdvancedUserInterface, \Serializable
143 /** 142 /**
144 * Set name 143 * Set name
145 * 144 *
146 * @param string $name 145 * @param string $name
147 * @return Users 146 * @return Users
148 */ 147 */
149 public function setName($name) 148 public function setName($name)
@@ -156,7 +155,7 @@ class Users implements AdvancedUserInterface, \Serializable
156 /** 155 /**
157 * Get name 156 * Get name
158 * 157 *
159 * @return string 158 * @return string
160 */ 159 */
161 public function getName() 160 public function getName()
162 { 161 {
@@ -166,7 +165,7 @@ class Users implements AdvancedUserInterface, \Serializable
166 /** 165 /**
167 * Set email 166 * Set email
168 * 167 *
169 * @param string $email 168 * @param string $email
170 * @return Users 169 * @return Users
171 */ 170 */
172 public function setEmail($email) 171 public function setEmail($email)
@@ -179,7 +178,7 @@ class Users implements AdvancedUserInterface, \Serializable
179 /** 178 /**
180 * Get email 179 * Get email
181 * 180 *
182 * @return string 181 * @return string
183 */ 182 */
184 public function getEmail() 183 public function getEmail()
185 { 184 {
@@ -208,7 +207,7 @@ class Users implements AdvancedUserInterface, \Serializable
208 */ 207 */
209 public function unserialize($serialized) 208 public function unserialize($serialized)
210 { 209 {
211 list ( 210 list(
212 $this->id, 211 $this->id,
213 ) = unserialize($serialized); 212 ) = unserialize($serialized);
214 } 213 }
diff --git a/src/Wallabag/CoreBundle/Entity/UsersConfig.php b/src/Wallabag/CoreBundle/Entity/UsersConfig.php
index 26fb44ee..0742edbc 100644
--- a/src/Wallabag/CoreBundle/Entity/UsersConfig.php
+++ b/src/Wallabag/CoreBundle/Entity/UsersConfig.php
@@ -42,12 +42,10 @@ class UsersConfig
42 */ 42 */
43 private $value; 43 private $value;
44 44
45
46
47 /** 45 /**
48 * Get id 46 * Get id
49 * 47 *
50 * @return integer 48 * @return integer
51 */ 49 */
52 public function getId() 50 public function getId()
53 { 51 {
@@ -57,7 +55,7 @@ class UsersConfig
57 /** 55 /**
58 * Set userId 56 * Set userId
59 * 57 *
60 * @param string $userId 58 * @param string $userId
61 * @return UsersConfig 59 * @return UsersConfig
62 */ 60 */
63 public function setUserId($userId) 61 public function setUserId($userId)
@@ -70,7 +68,7 @@ class UsersConfig
70 /** 68 /**
71 * Get userId 69 * Get userId
72 * 70 *
73 * @return string 71 * @return string
74 */ 72 */
75 public function getUserId() 73 public function getUserId()
76 { 74 {
@@ -80,7 +78,7 @@ class UsersConfig
80 /** 78 /**
81 * Set name 79 * Set name
82 * 80 *
83 * @param string $name 81 * @param string $name
84 * @return UsersConfig 82 * @return UsersConfig
85 */ 83 */
86 public function setName($name) 84 public function setName($name)
@@ -93,7 +91,7 @@ class UsersConfig
93 /** 91 /**
94 * Get name 92 * Get name
95 * 93 *
96 * @return string 94 * @return string
97 */ 95 */
98 public function getName() 96 public function getName()
99 { 97 {
@@ -103,7 +101,7 @@ class UsersConfig
103 /** 101 /**
104 * Set value 102 * Set value
105 * 103 *
106 * @param string $value 104 * @param string $value
107 * @return UsersConfig 105 * @return UsersConfig
108 */ 106 */
109 public function setValue($value) 107 public function setValue($value)
@@ -116,7 +114,7 @@ class UsersConfig
116 /** 114 /**
117 * Get value 115 * Get value
118 * 116 *
119 * @return string 117 * @return string
120 */ 118 */
121 public function getValue() 119 public function getValue()
122 { 120 {
diff --git a/src/Wallabag/CoreBundle/Helper/Content.php b/src/Wallabag/CoreBundle/Helper/Content.php
index 81acbad7..1cc5e4cf 100644
--- a/src/Wallabag/CoreBundle/Helper/Content.php
+++ b/src/Wallabag/CoreBundle/Helper/Content.php
@@ -8,8 +8,8 @@ class Content
8 8
9 private $body; 9 private $body;
10 10
11 public function __constructor() { 11 public function __constructor()
12 12 {
13 } 13 }
14 14
15 public function getTitle() 15 public function getTitle()
@@ -31,4 +31,4 @@ class Content
31 { 31 {
32 $this->body = $body; 32 $this->body = $body;
33 } 33 }
34} \ No newline at end of file 34}
diff --git a/src/Wallabag/CoreBundle/Helper/Entries.php b/src/Wallabag/CoreBundle/Helper/Entries.php
index a54c3a74..6eeca4ff 100644
--- a/src/Wallabag/CoreBundle/Helper/Entries.php
+++ b/src/Wallabag/CoreBundle/Helper/Entries.php
@@ -2,9 +2,6 @@
2 2
3namespace Wallabag\CoreBundle\Helper; 3namespace Wallabag\CoreBundle\Helper;
4 4
5 5class Entries
6class Entries { 6{
7 7}
8
9
10} \ No newline at end of file
diff --git a/src/Wallabag/CoreBundle/Helper/Tools.php b/src/Wallabag/CoreBundle/Helper/Tools.php
index c932f880..0fd5f259 100755
--- a/src/Wallabag/CoreBundle/Helper/Tools.php
+++ b/src/Wallabag/CoreBundle/Helper/Tools.php
@@ -2,9 +2,6 @@
2 2
3namespace Wallabag\CoreBundle\Helper; 3namespace Wallabag\CoreBundle\Helper;
4 4
5use \RecursiveIteratorIterator;
6use \RecursiveDirectoryIterator;
7
8final class Tools 5final class Tools
9{ 6{
10 /** 7 /**
@@ -18,7 +15,7 @@ final class Tools
18 $timeout = 15; 15 $timeout = 15;
19 $useragent = "Mozilla/5.0 (Windows NT 5.1; rv:18.0) Gecko/20100101 Firefox/18.0"; 16 $useragent = "Mozilla/5.0 (Windows NT 5.1; rv:18.0) Gecko/20100101 Firefox/18.0";
20 17
21 if (in_array ('curl', get_loaded_extensions())) { 18 if (in_array('curl', get_loaded_extensions())) {
22 # Fetch feed from URL 19 # Fetch feed from URL
23 $curl = curl_init(); 20 $curl = curl_init();
24 curl_setopt($curl, CURLOPT_URL, $url); 21 curl_setopt($curl, CURLOPT_URL, $url);
@@ -30,8 +27,8 @@ final class Tools
30 curl_setopt($curl, CURLOPT_HEADER, false); 27 curl_setopt($curl, CURLOPT_HEADER, false);
31 28
32 # for ssl, do not verified certificate 29 # for ssl, do not verified certificate
33 curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); 30 curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
34 curl_setopt($curl, CURLOPT_AUTOREFERER, TRUE ); 31 curl_setopt($curl, CURLOPT_AUTOREFERER, true);
35 32
36 # FeedBurner requires a proper USER-AGENT... 33 # FeedBurner requires a proper USER-AGENT...
37 curl_setopt($curl, CURL_HTTP_VERSION_1_1, true); 34 curl_setopt($curl, CURL_HTTP_VERSION_1_1, true);
@@ -48,13 +45,13 @@ final class Tools
48 array( 45 array(
49 'http' => array( 46 'http' => array(
50 'timeout' => $timeout, 47 'timeout' => $timeout,
51 'header' => "User-Agent: " . $useragent, 48 'header' => "User-Agent: ".$useragent,
52 'follow_location' => true 49 'follow_location' => true,
53 ), 50 ),
54 'ssl' => array( 51 'ssl' => array(
55 'verify_peer' => false, 52 'verify_peer' => false,
56 'allow_self_signed' => true 53 'allow_self_signed' => true,
57 ) 54 ),
58 ) 55 )
59 ); 56 );
60 57
@@ -62,13 +59,12 @@ final class Tools
62 $data = @file_get_contents($url, false, $context, -1, 4000000); 59 $data = @file_get_contents($url, false, $context, -1, 4000000);
63 60
64 if (isset($http_response_header) and isset($http_response_header[0])) { 61 if (isset($http_response_header) and isset($http_response_header[0])) {
65 $httpcodeOK = isset($http_response_header) and isset($http_response_header[0]) and ((strpos($http_response_header[0], '200 OK') !== FALSE) or (strpos($http_response_header[0], '301 Moved Permanently') !== FALSE)); 62 $httpcodeOK = isset($http_response_header) and isset($http_response_header[0]) and ((strpos($http_response_header[0], '200 OK') !== false) or (strpos($http_response_header[0], '301 Moved Permanently') !== false));
66 } 63 }
67 } 64 }
68 65
69 # if response is not empty and response is OK 66 # if response is not empty and response is OK
70 if (isset($data) and isset($httpcodeOK) and $httpcodeOK) { 67 if (isset($data) and isset($httpcodeOK) and $httpcodeOK) {
71
72 # take charset of page and get it 68 # take charset of page and get it
73 preg_match('#<meta .*charset=.*>#Usi', $data, $meta); 69 preg_match('#<meta .*charset=.*>#Usi', $data, $meta);
74 70
@@ -77,19 +73,20 @@ final class Tools
77 preg_match('#charset="?(.*)"#si', $meta[0], $encoding); 73 preg_match('#charset="?(.*)"#si', $meta[0], $encoding);
78 # if charset is found set it otherwise, set it to utf-8 74 # if charset is found set it otherwise, set it to utf-8
79 $html_charset = (!empty($encoding[1])) ? strtolower($encoding[1]) : 'utf-8'; 75 $html_charset = (!empty($encoding[1])) ? strtolower($encoding[1]) : 'utf-8';
80 if (empty($encoding[1])) $encoding[1] = 'utf-8'; 76 if (empty($encoding[1])) {
77 $encoding[1] = 'utf-8';
78 }
81 } else { 79 } else {
82 $html_charset = 'utf-8'; 80 $html_charset = 'utf-8';
83 $encoding[1] = ''; 81 $encoding[1] = '';
84 } 82 }
85 83
86 # replace charset of url to charset of page 84 # replace charset of url to charset of page
87 $data = str_replace('charset=' . $encoding[1], 'charset=' . $html_charset, $data); 85 $data = str_replace('charset='.$encoding[1], 'charset='.$html_charset, $data);
88 86
89 return $data; 87 return $data;
90 } 88 } else {
91 else { 89 return false;
92 return FALSE;
93 } 90 }
94 } 91 }
95 92
@@ -101,7 +98,7 @@ final class Tools
101 */ 98 */
102 public static function encodeString($string) 99 public static function encodeString($string)
103 { 100 {
104 return sha1($string . SALT); 101 return sha1($string.SALT);
105 } 102 }
106 103
107 public static function generateToken() 104 public static function generateToken()
@@ -113,12 +110,10 @@ final class Tools
113 } else { 110 } else {
114 $token = substr(base64_encode(file_get_contents('/dev/urandom', false, null, 0, 20)), 0, 15); 111 $token = substr(base64_encode(file_get_contents('/dev/urandom', false, null, 0, 20)), 0, 15);
115 } 112 }
116 } 113 } else {
117 else {
118 $token = substr(base64_encode(uniqid(mt_rand(), true)), 0, 20); 114 $token = substr(base64_encode(uniqid(mt_rand(), true)), 0, 20);
119 } 115 }
120 116
121 return str_replace('+', '', $token); 117 return str_replace('+', '', $token);
122 } 118 }
123
124} 119}
diff --git a/src/Wallabag/CoreBundle/Helper/Url.php b/src/Wallabag/CoreBundle/Helper/Url.php
index b076e7c7..35eb260d 100644
--- a/src/Wallabag/CoreBundle/Helper/Url.php
+++ b/src/Wallabag/CoreBundle/Helper/Url.php
@@ -6,20 +6,23 @@ class Url
6{ 6{
7 public $url; 7 public $url;
8 8
9 function __construct($url) 9 public function __construct($url)
10 { 10 {
11 $this->url = base64_decode($url); 11 $this->url = base64_decode($url);
12 } 12 }
13 13
14 public function getUrl() { 14 public function getUrl()
15 {
15 return $this->url; 16 return $this->url;
16 } 17 }
17 18
18 public function setUrl($url) { 19 public function setUrl($url)
20 {
19 $this->url = $url; 21 $this->url = $url;
20 } 22 }
21 23
22 public function isCorrect() { 24 public function isCorrect()
23 return filter_var($this->url, FILTER_VALIDATE_URL) !== FALSE; 25 {
26 return filter_var($this->url, FILTER_VALIDATE_URL) !== false;
24 } 27 }
25} \ No newline at end of file 28}
diff --git a/src/Wallabag/CoreBundle/Repository/EntriesRepository.php b/src/Wallabag/CoreBundle/Repository/EntriesRepository.php
index e63c67e2..d87eb373 100644
--- a/src/Wallabag/CoreBundle/Repository/EntriesRepository.php
+++ b/src/Wallabag/CoreBundle/Repository/EntriesRepository.php
@@ -6,7 +6,6 @@ use Doctrine\ORM\Query;
6use Doctrine\ORM\EntityRepository; 6use Doctrine\ORM\EntityRepository;
7use Doctrine\ORM\Tools\Pagination\Paginator; 7use Doctrine\ORM\Tools\Pagination\Paginator;
8use Wallabag\CoreBundle\Entity\Entries; 8use Wallabag\CoreBundle\Entity\Entries;
9use Wallabag\CoreBundle\Service\Extractor;
10 9
11class EntriesRepository extends EntityRepository 10class EntriesRepository extends EntityRepository
12{ 11{
@@ -15,7 +14,7 @@ class EntriesRepository extends EntityRepository
15 * 14 *
16 * @param $userId 15 * @param $userId
17 * @param $firstResult 16 * @param $firstResult
18 * @param int $maxResults 17 * @param int $maxResults
19 * @return Paginator 18 * @return Paginator
20 */ 19 */
21 public function findUnreadByUser($userId, $firstResult, $maxResults = 12) 20 public function findUnreadByUser($userId, $firstResult, $maxResults = 12)
@@ -38,7 +37,7 @@ class EntriesRepository extends EntityRepository
38 * 37 *
39 * @param $userId 38 * @param $userId
40 * @param $firstResult 39 * @param $firstResult
41 * @param int $maxResults 40 * @param int $maxResults
42 * @return Paginator 41 * @return Paginator
43 */ 42 */
44 public function findArchiveByUser($userId, $firstResult, $maxResults = 12) 43 public function findArchiveByUser($userId, $firstResult, $maxResults = 12)
@@ -61,7 +60,7 @@ class EntriesRepository extends EntityRepository
61 * 60 *
62 * @param $userId 61 * @param $userId
63 * @param $firstResult 62 * @param $firstResult
64 * @param int $maxResults 63 * @param int $maxResults
65 * @return Paginator 64 * @return Paginator
66 */ 65 */
67 public function findStarredByUser($userId, $firstResult, $maxResults = 12) 66 public function findStarredByUser($userId, $firstResult, $maxResults = 12)
diff --git a/src/Wallabag/CoreBundle/Resources/config/routing.yml b/src/Wallabag/CoreBundle/Resources/config/routing.yml
index 327d49d8..ec1d23cc 100644
--- a/src/Wallabag/CoreBundle/Resources/config/routing.yml
+++ b/src/Wallabag/CoreBundle/Resources/config/routing.yml
@@ -1,3 +1,3 @@
1_wllbg: 1_wllbg:
2 resource: "@WallabagCoreBundle/Controller/EntryController.php" 2 resource: "@WallabagCoreBundle/Controller/EntryController.php"
3 type: annotation \ No newline at end of file 3 type: annotation
diff --git a/src/Wallabag/CoreBundle/Resources/config/routing_rest.yml b/src/Wallabag/CoreBundle/Resources/config/routing_rest.yml
index c876adfb..d3af6b72 100644
--- a/src/Wallabag/CoreBundle/Resources/config/routing_rest.yml
+++ b/src/Wallabag/CoreBundle/Resources/config/routing_rest.yml
@@ -1,4 +1,4 @@
1entries: 1entries:
2 type: rest 2 type: rest
3 resource: "WallabagCoreBundle:WallabagRest" 3 resource: "WallabagCoreBundle:WallabagRest"
4 name_prefix: api_ \ No newline at end of file 4 name_prefix: api_
diff --git a/src/Wallabag/CoreBundle/Resources/config/services.xml b/src/Wallabag/CoreBundle/Resources/config/services.xml
index d5bc5cca..859665ca 100644
--- a/src/Wallabag/CoreBundle/Resources/config/services.xml
+++ b/src/Wallabag/CoreBundle/Resources/config/services.xml
@@ -25,5 +25,3 @@
25 </services> 25 </services>
26 26
27</container> 27</container>
28
29
diff --git a/src/Wallabag/CoreBundle/Resources/views/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/Entry/entry.html.twig
index 78dfa7c0..edb15d55 100644
--- a/src/Wallabag/CoreBundle/Resources/views/Entry/entry.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/Entry/entry.html.twig
@@ -101,4 +101,4 @@
101 }); 101 });
102 }); 102 });
103 </script> 103 </script>
104{% endblock %} \ No newline at end of file 104{% endblock %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/Entry/new.html.twig b/src/Wallabag/CoreBundle/Resources/views/Entry/new.html.twig
index df6926a0..b6de7d23 100644
--- a/src/Wallabag/CoreBundle/Resources/views/Entry/new.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/Entry/new.html.twig
@@ -8,4 +8,4 @@
8 8
9{% block content %} 9{% block content %}
10 {{ form(form) }} 10 {{ form(form) }}
11{% endblock %} \ No newline at end of file 11{% endblock %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/Static/about.html.twig b/src/Wallabag/CoreBundle/Resources/views/Static/about.html.twig
index 0585ecca..b8d3c7b6 100755
--- a/src/Wallabag/CoreBundle/Resources/views/Static/about.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/Static/about.html.twig
@@ -30,11 +30,11 @@
30 <p>{% trans %}wallabag is a read-it-later application: you can save a web page by keeping only content. Elements like ads or menus are deleted.{% endtrans %}</p> 30 <p>{% trans %}wallabag is a read-it-later application: you can save a web page by keeping only content. Elements like ads or menus are deleted.{% endtrans %}</p>
31 31
32 <h2>{% trans %}Getting help{% endtrans %}</h2> 32 <h2>{% trans %}Getting help{% endtrans %}</h2>
33 33
34 <dl> 34 <dl>
35 <dt>{% trans %}Documentation{% endtrans %}</dt> 35 <dt>{% trans %}Documentation{% endtrans %}</dt>
36 <dd><a href="https://doc.wallabag.org/">Online documentation</a></dd> 36 <dd><a href="https://doc.wallabag.org/">Online documentation</a></dd>
37 37
38 <dt>{% trans %}Support{% endtrans %}</dt> 38 <dt>{% trans %}Support{% endtrans %}</dt>
39 <dd><a href="http://support.wallabag.org/">http://support.wallabag.org/</a></dd> 39 <dd><a href="http://support.wallabag.org/">http://support.wallabag.org/</a></dd>
40 </dl> 40 </dl>
diff --git a/src/Wallabag/CoreBundle/Resources/views/_bookmarklet.html.twig b/src/Wallabag/CoreBundle/Resources/views/_bookmarklet.html.twig
index d432909a..fd662c19 100644
--- a/src/Wallabag/CoreBundle/Resources/views/_bookmarklet.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/_bookmarklet.html.twig
@@ -1,3 +1,3 @@
1 <script type="text/javascript"> 1 <script type="text/javascript">
2 top["bookmarklet-url@wallabag.org"]=""+"<!DOCTYPE html>"+"<html>"+"<head>"+"<title>bag it!</title>"+'<link rel="icon" href="tpl/img/favicon.ico" />'+"</head>"+"<body>"+"<script>"+"window.onload=function(){"+"window.setTimeout(function(){"+"history.back();"+"},250);"+"};"+"</scr"+"ipt>"+"</body>"+"</html>" 2 top["bookmarklet-url@wallabag.org"]=""+"<!DOCTYPE html>"+"<html>"+"<head>"+"<title>bag it!</title>"+'<link rel="icon" href="tpl/img/favicon.ico" />'+"</head>"+"<body>"+"<script>"+"window.onload=function(){"+"window.setTimeout(function(){"+"history.back();"+"},250);"+"};"+"</scr"+"ipt>"+"</body>"+"</html>"
3 </script> \ No newline at end of file 3 </script>
diff --git a/src/Wallabag/CoreBundle/Resources/views/_footer.html.twig b/src/Wallabag/CoreBundle/Resources/views/_footer.html.twig
index c897a97e..26411da9 100644
--- a/src/Wallabag/CoreBundle/Resources/views/_footer.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/_footer.html.twig
@@ -1,3 +1,3 @@
1 <footer class="w600p center mt3 mb3 smaller txtright"> 1 <footer class="w600p center mt3 mb3 smaller txtright">
2 <p>{% trans %}powered by{% endtrans %} <a href="http://wallabag.org">wallabag</a></p> 2 <p>{% trans %}powered by{% endtrans %} <a href="http://wallabag.org">wallabag</a></p>
3 </footer> \ No newline at end of file 3 </footer>
diff --git a/src/Wallabag/CoreBundle/Resources/views/_head.html.twig b/src/Wallabag/CoreBundle/Resources/views/_head.html.twig
index 7ef79a2f..f123183b 100755
--- a/src/Wallabag/CoreBundle/Resources/views/_head.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/_head.html.twig
@@ -37,4 +37,3 @@
37 <script src="{{ asset('themes/_global/js/saveLink.js') }}"></script> 37 <script src="{{ asset('themes/_global/js/saveLink.js') }}"></script>
38 <script src="{{ asset('themes/_global/js/popupForm.js') }}"></script> 38 <script src="{{ asset('themes/_global/js/popupForm.js') }}"></script>
39 <script src="{{ asset('themes/baggy/js/closeMessage.js') }}"></script> 39 <script src="{{ asset('themes/baggy/js/closeMessage.js') }}"></script>
40
diff --git a/src/Wallabag/CoreBundle/Resources/views/_menu.html.twig b/src/Wallabag/CoreBundle/Resources/views/_menu.html.twig
index 3065ce44..2e3b6d08 100644
--- a/src/Wallabag/CoreBundle/Resources/views/_menu.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/_menu.html.twig
@@ -12,4 +12,3 @@
12 <li><a href={{ path('about') }}>{% trans %}about{% endtrans %}</a></li> 12 <li><a href={{ path('about') }}>{% trans %}about{% endtrans %}</a></li>
13 <li><a class="icon icon-power" href="{{ path('logout') }}" title="{% trans %}logout{% endtrans %}">{% trans %}logout{% endtrans %}</a></li> 13 <li><a class="icon icon-power" href="{{ path('logout') }}" title="{% trans %}logout{% endtrans %}">{% trans %}logout{% endtrans %}</a></li>
14 </ul> 14 </ul>
15
diff --git a/src/Wallabag/CoreBundle/Resources/views/baggy/config.twig b/src/Wallabag/CoreBundle/Resources/views/baggy/config.twig
index 6031f489..c5c07d49 100755
--- a/src/Wallabag/CoreBundle/Resources/views/baggy/config.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/baggy/config.twig
@@ -160,7 +160,7 @@
160 </div> 160 </div>
161 </fieldset> 161 </fieldset>
162 </form> 162 </form>
163 163
164 <h2>{% trans "Delete account" %}</h2> 164 <h2>{% trans "Delete account" %}</h2>
165 {% if not only_user %}<form method="post" action="?deluser"> 165 {% if not only_user %}<form method="post" action="?deluser">
166 <p>{% trans "You can delete your account by entering your password and validating." %}<br /><b>{% trans "Be careful, data will be erased forever (that is a very long time)." %}</b></p> 166 <p>{% trans "You can delete your account by entering your password and validating." %}<br /><b>{% trans "Be careful, data will be erased forever (that is a very long time)." %}</b></p>
diff --git a/src/Wallabag/CoreBundle/Resources/views/baggy/layout-login.twig b/src/Wallabag/CoreBundle/Resources/views/baggy/layout-login.twig
index 4078fbb0..ae3f086c 100644
--- a/src/Wallabag/CoreBundle/Resources/views/baggy/layout-login.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/baggy/layout-login.twig
@@ -28,4 +28,4 @@
28 </div> 28 </div>
29{% include '_footer.twig' %} 29{% include '_footer.twig' %}
30 </body> 30 </body>
31</html> \ No newline at end of file 31</html>
diff --git a/src/Wallabag/CoreBundle/Resources/views/baggy/login.twig b/src/Wallabag/CoreBundle/Resources/views/baggy/login.twig
index 58290e9c..d4eb46d2 100644
--- a/src/Wallabag/CoreBundle/Resources/views/baggy/login.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/baggy/login.twig
@@ -17,7 +17,7 @@
17 <input class="col" type="password" id="password" name="password" placeholder="{% trans "Password" %}" tabindex="2" {% if constant('MODE_DEMO') == 1 %}value="poche"{% endif %} /> 17 <input class="col" type="password" id="password" name="password" placeholder="{% trans "Password" %}" tabindex="2" {% if constant('MODE_DEMO') == 1 %}value="poche"{% endif %} />
18 </div> 18 </div>
19 <div class="row"> 19 <div class="row">
20 20
21 <div class="col"> 21 <div class="col">
22 <input type="checkbox" id="longlastingsession" name="longlastingsession" tabindex="3" /> <label for="longlastingsession">{% trans "Stay signed in" %}</label><br /> 22 <input type="checkbox" id="longlastingsession" name="longlastingsession" tabindex="3" /> <label for="longlastingsession">{% trans "Stay signed in" %}</label><br />
23 <small class="inbl">{% trans "(Do not check on public computers)" %}</small> 23 <small class="inbl">{% trans "(Do not check on public computers)" %}</small>
diff --git a/src/Wallabag/CoreBundle/Resources/views/default/_bookmarklet.twig b/src/Wallabag/CoreBundle/Resources/views/default/_bookmarklet.twig
index 61996353..c7e2f66e 100644
--- a/src/Wallabag/CoreBundle/Resources/views/default/_bookmarklet.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/default/_bookmarklet.twig
@@ -1,3 +1,3 @@
1 <script type="text/javascript"> 1 <script type="text/javascript">
2 top["bookmarklet-url@wallabag.org"]=""+"<!DOCTYPE html>"+"<html>"+"<head>"+"<title>bag it!</title>"+'<link rel="icon" href="{{poche_url}}tpl/img/favicon.ico" />'+"</head>"+"<body>"+"<script>"+"window.onload=function(){"+"window.setTimeout(function(){"+"history.back();"+"},250);"+"};"+"</scr"+"ipt>"+"</body>"+"</html>" 2 top["bookmarklet-url@wallabag.org"]=""+"<!DOCTYPE html>"+"<html>"+"<head>"+"<title>bag it!</title>"+'<link rel="icon" href="{{poche_url}}tpl/img/favicon.ico" />'+"</head>"+"<body>"+"<script>"+"window.onload=function(){"+"window.setTimeout(function(){"+"history.back();"+"},250);"+"};"+"</scr"+"ipt>"+"</body>"+"</html>"
3 </script> \ No newline at end of file 3 </script>
diff --git a/src/Wallabag/CoreBundle/Resources/views/default/_footer.twig b/src/Wallabag/CoreBundle/Resources/views/default/_footer.twig
index 213a4aca..25539f6b 100644
--- a/src/Wallabag/CoreBundle/Resources/views/default/_footer.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/default/_footer.twig
@@ -1,4 +1,4 @@
1 <footer class="w600p center mt3 mb3 smaller txtright"> 1 <footer class="w600p center mt3 mb3 smaller txtright">
2 <p>{% trans "powered by" %} <a href="http://wallabag.org">wallabag</a></p> 2 <p>{% trans "powered by" %} <a href="http://wallabag.org">wallabag</a></p>
3 {% if constant('DEBUG_POCHE') == 1 %}<p><strong>{% trans "debug mode is on so cache is off." %} {% trans "your wallabag version:" %}{{constant('WALLABAG')}}. {% trans "storage:" %} {{constant('STORAGE')}}</strong></p>{% endif %} 3 {% if constant('DEBUG_POCHE') == 1 %}<p><strong>{% trans "debug mode is on so cache is off." %} {% trans "your wallabag version:" %}{{constant('WALLABAG')}}. {% trans "storage:" %} {{constant('STORAGE')}}</strong></p>{% endif %}
4 </footer> \ No newline at end of file 4 </footer>
diff --git a/src/Wallabag/CoreBundle/Resources/views/default/_import.twig b/src/Wallabag/CoreBundle/Resources/views/default/_import.twig
index c59b7a15..63a2d3e2 100755
--- a/src/Wallabag/CoreBundle/Resources/views/default/_import.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/default/_import.twig
@@ -2,7 +2,7 @@
2<!-- 2<!--
3 $(document).ready(function() { 3 $(document).ready(function() {
4 $("body").css("cursor", "wait"); 4 $("body").css("cursor", "wait");
5 5
6 setTimeout(function(){ 6 setTimeout(function(){
7 window.location = './?import'; 7 window.location = './?import';
8 }, {{ import.delay }} ); 8 }, {{ import.delay }} );
diff --git a/src/Wallabag/CoreBundle/Resources/views/default/_menu.twig b/src/Wallabag/CoreBundle/Resources/views/default/_menu.twig
index eedf84f1..83fa3717 100644
--- a/src/Wallabag/CoreBundle/Resources/views/default/_menu.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/default/_menu.twig
@@ -11,4 +11,3 @@
11 </ul> 11 </ul>
12 {% include '_pocheit-form.twig' %} 12 {% include '_pocheit-form.twig' %}
13 {% include '_search-form.twig' %} 13 {% include '_search-form.twig' %}
14
diff --git a/src/Wallabag/CoreBundle/Resources/views/default/_messages.twig b/src/Wallabag/CoreBundle/Resources/views/default/_messages.twig
index 679aa098..b8481494 100644
--- a/src/Wallabag/CoreBundle/Resources/views/default/_messages.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/default/_messages.twig
@@ -1 +1 @@
{{ messages | raw }} \ No newline at end of file {{ messages | raw }}
diff --git a/src/Wallabag/CoreBundle/Resources/views/default/_search-form.twig b/src/Wallabag/CoreBundle/Resources/views/default/_search-form.twig
index 0cf6097a..70f97356 100755
--- a/src/Wallabag/CoreBundle/Resources/views/default/_search-form.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/default/_search-form.twig
@@ -1,4 +1,4 @@
1<div id="search-form" class="messages info"> 1<div id="search-form" class="messages info">
2<form method="get" action="index.php"> 2<form method="get" action="index.php">
3 <p> 3 <p>
4 <input type="hidden" name="view" value="search"></input> 4 <input type="hidden" name="view" value="search"></input>
diff --git a/src/Wallabag/CoreBundle/Resources/views/default/about.twig b/src/Wallabag/CoreBundle/Resources/views/default/about.twig
index 50ffd8ef..7ddb19d6 100755
--- a/src/Wallabag/CoreBundle/Resources/views/default/about.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/default/about.twig
@@ -70,5 +70,5 @@
70 70
71 <dt>PHPePub</dt> 71 <dt>PHPePub</dt>
72 <dd><a href="https://github.com/Grandt/PHPePub/">https://github.com/Grandt/PHPePub/</a></dd> 72 <dd><a href="https://github.com/Grandt/PHPePub/">https://github.com/Grandt/PHPePub/</a></dd>
73 </dl> 73 </dl>
74{% endblock %} 74{% endblock %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/default/config.twig b/src/Wallabag/CoreBundle/Resources/views/default/config.twig
index b7d91937..6769da74 100755
--- a/src/Wallabag/CoreBundle/Resources/views/default/config.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/default/config.twig
@@ -45,7 +45,7 @@
45 {% trans "You can regenerate your token: <a href='?feed&amp;action=generate'>generate!</a>." %} 45 {% trans "You can regenerate your token: <a href='?feed&amp;action=generate'>generate!</a>." %}
46 </p> 46 </p>
47 {% endif %} 47 {% endif %}
48 48
49 <h2>{% trans "Change your theme" %}</h2> 49 <h2>{% trans "Change your theme" %}</h2>
50 <form method="post" action="?updatetheme" name="changethemeform"> 50 <form method="post" action="?updatetheme" name="changethemeform">
51 <fieldset class="w500p inline"> 51 <fieldset class="w500p inline">
diff --git a/src/Wallabag/CoreBundle/Resources/views/default/export.twig b/src/Wallabag/CoreBundle/Resources/views/default/export.twig
index 4adb9540..18a98a87 100644
--- a/src/Wallabag/CoreBundle/Resources/views/default/export.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/default/export.twig
@@ -1 +1 @@
{{ export }} \ No newline at end of file {{ export }}
diff --git a/src/Wallabag/CoreBundle/Resources/views/default/layout.twig b/src/Wallabag/CoreBundle/Resources/views/default/layout.twig
index dfebc3ea..d32395a2 100644
--- a/src/Wallabag/CoreBundle/Resources/views/default/layout.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/default/layout.twig
@@ -28,4 +28,4 @@
28 </div> 28 </div>
29{% include '_footer.twig' %} 29{% include '_footer.twig' %}
30 </body> 30 </body>
31</html> \ No newline at end of file 31</html>
diff --git a/src/Wallabag/CoreBundle/Resources/views/default/tags.twig b/src/Wallabag/CoreBundle/Resources/views/default/tags.twig
index e5be748e..47359ed1 100755
--- a/src/Wallabag/CoreBundle/Resources/views/default/tags.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/default/tags.twig
@@ -15,4 +15,4 @@
15 15
16 {% endfor %} 16 {% endfor %}
17 </div> 17 </div>
18{% endblock %} \ No newline at end of file 18{% endblock %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/default/view.twig b/src/Wallabag/CoreBundle/Resources/views/default/view.twig
index 8f3a26c3..154de1e4 100755
--- a/src/Wallabag/CoreBundle/Resources/views/default/view.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/default/view.twig
@@ -42,7 +42,7 @@
42 <script src="{{ poche_url }}themes/_global/js/restoreScroll.js"></script> 42 <script src="{{ poche_url }}themes/_global/js/restoreScroll.js"></script>
43 <script type="text/javascript"> 43 <script type="text/javascript">
44 $(document).ready(function() { 44 $(document).ready(function() {
45 45
46 // toggle read property of current article 46 // toggle read property of current article
47 $('#markAsRead').click(function(){ 47 $('#markAsRead').click(function(){
48 $("body").css("cursor", "wait"); 48 $("body").css("cursor", "wait");
@@ -50,11 +50,11 @@
50 function( data ) { 50 function( data ) {
51 if ( data == '1' ) { 51 if ( data == '1' ) {
52 if ( $('#markAsRead').hasClass("archive-off") ) { 52 if ( $('#markAsRead').hasClass("archive-off") ) {
53 $('#markAsRead').removeClass("archive-off"); 53 $('#markAsRead').removeClass("archive-off");
54 $('#markAsRead').addClass("archive"); 54 $('#markAsRead').addClass("archive");
55 } 55 }
56 else { 56 else {
57 $('#markAsRead').removeClass("archive"); 57 $('#markAsRead').removeClass("archive");
58 $('#markAsRead').addClass("archive-off"); 58 $('#markAsRead').addClass("archive-off");
59 } 59 }
60 } 60 }
@@ -64,7 +64,7 @@
64 }); 64 });
65 $("body").css("cursor", "auto"); 65 $("body").css("cursor", "auto");
66 }); 66 });
67 67
68 // toggle favorite property of current article 68 // toggle favorite property of current article
69 $('#setFav').click(function(){ 69 $('#setFav').click(function(){
70 $("body").css("cursor", "wait"); 70 $("body").css("cursor", "wait");
@@ -72,11 +72,11 @@
72 function( data ) { 72 function( data ) {
73 if ( data == '1' ) { 73 if ( data == '1' ) {
74 if ( $('#setFav').hasClass("fav-off") ) { 74 if ( $('#setFav').hasClass("fav-off") ) {
75 $('#setFav').removeClass("fav-off"); 75 $('#setFav').removeClass("fav-off");
76 $('#setFav').addClass("fav"); 76 $('#setFav').addClass("fav");
77 } 77 }
78 else { 78 else {
79 $('#setFav').removeClass("fav"); 79 $('#setFav').removeClass("fav");
80 $('#setFav').addClass("fav-off"); 80 $('#setFav').addClass("fav-off");
81 } 81 }
82 } 82 }
@@ -86,8 +86,8 @@
86 }); 86 });
87 $("body").css("cursor", "auto"); 87 $("body").css("cursor", "auto");
88 }); 88 });
89 89
90 // set percent of read on startup 90 // set percent of read on startup
91 if ( $(document).height() <= $(window).innerHeight() ) { 91 if ( $(document).height() <= $(window).innerHeight() ) {
92 pp = 100; 92 pp = 100;
93 } 93 }
@@ -95,7 +95,7 @@
95 pp = 0; 95 pp = 0;
96 } 96 }
97 $('#readLeftPercent').text( pp + '%' ); 97 $('#readLeftPercent').text( pp + '%' );
98 98
99 99
100 $(window).scroll(function(e){ 100 $(window).scroll(function(e){
101 var scrollTop = $(window).scrollTop(); 101 var scrollTop = $(window).scrollTop();
@@ -103,7 +103,7 @@
103 var scrollPercent = (scrollTop) / (docHeight); 103 var scrollPercent = (scrollTop) / (docHeight);
104 var scrollPercentRounded = Math.round(scrollPercent*100)/100; 104 var scrollPercentRounded = Math.round(scrollPercent*100)/100;
105 savePercent({{ entry.id|e }}, scrollPercentRounded); 105 savePercent({{ entry.id|e }}, scrollPercentRounded);
106 106
107 // change percent of read on scroll 107 // change percent of read on scroll
108 pp = Math.round(scrollTop * 100 / ( docHeight - $(window).innerHeight() )); 108 pp = Math.round(scrollTop * 100 / ( docHeight - $(window).innerHeight() ));
109 $('#readLeftPercent').text( pp + '%' ); 109 $('#readLeftPercent').text( pp + '%' );
diff --git a/src/Wallabag/CoreBundle/Resources/views/layout-login.html.twig b/src/Wallabag/CoreBundle/Resources/views/layout-login.html.twig
index 9c39ea9f..d1aacc47 100644
--- a/src/Wallabag/CoreBundle/Resources/views/layout-login.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/layout-login.html.twig
@@ -23,4 +23,4 @@
23 </div> 23 </div>
24 {% include "WallabagCoreBundle::_footer.html.twig" %} 24 {% include "WallabagCoreBundle::_footer.html.twig" %}
25 </body> 25 </body>
26</html> \ No newline at end of file 26</html>
diff --git a/src/Wallabag/CoreBundle/Resources/views/layout.html.twig b/src/Wallabag/CoreBundle/Resources/views/layout.html.twig
index 1f1753a4..f062672c 100644
--- a/src/Wallabag/CoreBundle/Resources/views/layout.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/layout.html.twig
@@ -30,4 +30,4 @@
30 </div> 30 </div>
31 {% include "WallabagCoreBundle::_footer.html.twig" %} 31 {% include "WallabagCoreBundle::_footer.html.twig" %}
32 </body> 32 </body>
33</html> \ No newline at end of file 33</html>
diff --git a/src/Wallabag/CoreBundle/Security/Authentication/Provider/WsseProvider.php b/src/Wallabag/CoreBundle/Security/Authentication/Provider/WsseProvider.php
index ac57e27d..5499f400 100644
--- a/src/Wallabag/CoreBundle/Security/Authentication/Provider/WsseProvider.php
+++ b/src/Wallabag/CoreBundle/Security/Authentication/Provider/WsseProvider.php
@@ -56,4 +56,4 @@ class WsseProvider implements AuthenticationProviderInterface
56 { 56 {
57 return $token instanceof WsseUserToken; 57 return $token instanceof WsseUserToken;
58 } 58 }
59} \ No newline at end of file 59}
diff --git a/src/Wallabag/CoreBundle/Security/Authentication/Token/WsseUserToken.php b/src/Wallabag/CoreBundle/Security/Authentication/Token/WsseUserToken.php
index b189e22a..ea6fb9bf 100644
--- a/src/Wallabag/CoreBundle/Security/Authentication/Token/WsseUserToken.php
+++ b/src/Wallabag/CoreBundle/Security/Authentication/Token/WsseUserToken.php
@@ -20,4 +20,4 @@ class WsseUserToken extends AbstractToken
20 { 20 {
21 return ''; 21 return '';
22 } 22 }
23} \ No newline at end of file 23}
diff --git a/src/Wallabag/CoreBundle/Security/Firewall/WsseListener.php b/src/Wallabag/CoreBundle/Security/Firewall/WsseListener.php
index b2474785..4d4f2145 100644
--- a/src/Wallabag/CoreBundle/Security/Firewall/WsseListener.php
+++ b/src/Wallabag/CoreBundle/Security/Firewall/WsseListener.php
@@ -52,7 +52,6 @@ class WsseListener implements ListenerInterface
52 $response = new Response(); 52 $response = new Response();
53 $response->setStatusCode(403); 53 $response->setStatusCode(403);
54 $event->setResponse($response); 54 $event->setResponse($response);
55
56 } 55 }
57 } 56 }
58} \ No newline at end of file 57}
diff --git a/src/Wallabag/CoreBundle/Service/Extractor.php b/src/Wallabag/CoreBundle/Service/Extractor.php
index 1c6ff0ae..d38b0d76 100644
--- a/src/Wallabag/CoreBundle/Service/Extractor.php
+++ b/src/Wallabag/CoreBundle/Service/Extractor.php
@@ -7,29 +7,30 @@ use Wallabag\CoreBundle\Helper\Url;
7 7
8final class Extractor 8final class Extractor
9{ 9{
10 public static function extract($url) { 10 public static function extract($url)
11 {
11 $pageContent = Extractor::getPageContent(new Url(base64_encode($url))); 12 $pageContent = Extractor::getPageContent(new Url(base64_encode($url)));
12 $title = ($pageContent['rss']['channel']['item']['title'] != '') ? $pageContent['rss']['channel']['item']['title'] : _('Untitled'); 13 $title = ($pageContent['rss']['channel']['item']['title'] != '') ? $pageContent['rss']['channel']['item']['title'] : _('Untitled');
13 $body = $pageContent['rss']['channel']['item']['description']; 14 $body = $pageContent['rss']['channel']['item']['description'];
14 15
15 $content = new Content(); 16 $content = new Content();
16 $content->setTitle($title); 17 $content->setTitle($title);
17 $content->setBody($body);; 18 $content->setBody($body);
18 19
19 return $content; 20 return $content;
20 } 21 }
21 /** 22 /**
22 * Get the content for a given URL (by a call to FullTextFeed) 23 * Get the content for a given URL (by a call to FullTextFeed)
23 * 24 *
24 * @param Url $url 25 * @param Url $url
25 * @return mixed 26 * @return mixed
26 */ 27 */
27 public static function getPageContent(Url $url) 28 public static function getPageContent(Url $url)
28 { 29 {
29 // Saving and clearing context 30 // Saving and clearing context
30 $REAL = array(); 31 $REAL = array();
31 foreach( $GLOBALS as $key => $value ) { 32 foreach ($GLOBALS as $key => $value) {
32 if( $key != 'GLOBALS' && $key != '_SESSION' && $key != 'HTTP_SESSION_VARS' ) { 33 if ($key != 'GLOBALS' && $key != '_SESSION' && $key != 'HTTP_SESSION_VARS') {
33 $GLOBALS[$key] = array(); 34 $GLOBALS[$key] = array();
34 $REAL[$key] = $value; 35 $REAL[$key] = $value;
35 } 36 }
@@ -37,38 +38,39 @@ final class Extractor
37 // Saving and clearing session 38 // Saving and clearing session
38 if (isset($_SESSION)) { 39 if (isset($_SESSION)) {
39 $REAL_SESSION = array(); 40 $REAL_SESSION = array();
40 foreach( $_SESSION as $key => $value ) { 41 foreach ($_SESSION as $key => $value) {
41 $REAL_SESSION[$key] = $value; 42 $REAL_SESSION[$key] = $value;
42 unset($_SESSION[$key]); 43 unset($_SESSION[$key]);
43 } 44 }
44 } 45 }
45 46
46 // Running code in different context 47 // Running code in different context
47 $scope = function() { 48 $scope = function () {
48 extract( func_get_arg(1) ); 49 extract(func_get_arg(1));
49 $_GET = $_REQUEST = array( 50 $_GET = $_REQUEST = array(
50 "url" => $url->getUrl(), 51 "url" => $url->getUrl(),
51 "max" => 5, 52 "max" => 5,
52 "links" => "preserve", 53 "links" => "preserve",
53 "exc" => "", 54 "exc" => "",
54 "format" => "json", 55 "format" => "json",
55 "submit" => "Create Feed" 56 "submit" => "Create Feed",
56 ); 57 );
57 ob_start(); 58 ob_start();
58 require func_get_arg(0); 59 require func_get_arg(0);
59 $json = ob_get_contents(); 60 $json = ob_get_contents();
60 ob_end_clean(); 61 ob_end_clean();
62
61 return $json; 63 return $json;
62 }; 64 };
63 65
64 // Silence $scope function to avoid 66 // Silence $scope function to avoid
65 // issues with FTRSS when error_reporting is to high 67 // issues with FTRSS when error_reporting is to high
66 // FTRSS generates PHP warnings which break output 68 // FTRSS generates PHP warnings which break output
67 $json = @$scope(__DIR__ . "/../../../../vendor/wallabag/Fivefilters_Libraries/makefulltextfeed.php", array("url" => $url)); 69 $json = @$scope(__DIR__."/../../../../vendor/wallabag/Fivefilters_Libraries/makefulltextfeed.php", array("url" => $url));
68 70
69 // Clearing and restoring context 71 // Clearing and restoring context
70 foreach ($GLOBALS as $key => $value) { 72 foreach ($GLOBALS as $key => $value) {
71 if($key != "GLOBALS" && $key != "_SESSION" ) { 73 if ($key != "GLOBALS" && $key != "_SESSION") {
72 unset($GLOBALS[$key]); 74 unset($GLOBALS[$key]);
73 } 75 }
74 } 76 }
@@ -78,15 +80,15 @@ final class Extractor
78 80
79 // Clearing and restoring session 81 // Clearing and restoring session
80 if (isset($REAL_SESSION)) { 82 if (isset($REAL_SESSION)) {
81 foreach($_SESSION as $key => $value) { 83 foreach ($_SESSION as $key => $value) {
82 unset($_SESSION[$key]); 84 unset($_SESSION[$key]);
83 } 85 }
84 86
85 foreach($REAL_SESSION as $key => $value) { 87 foreach ($REAL_SESSION as $key => $value) {
86 $_SESSION[$key] = $value; 88 $_SESSION[$key] = $value;
87 } 89 }
88 } 90 }
89 91
90 return json_decode($json, true); 92 return json_decode($json, true);
91 } 93 }
92} \ No newline at end of file 94}
diff --git a/src/Wallabag/CoreBundle/Twig/Extension/WallabagExtension.php b/src/Wallabag/CoreBundle/Twig/Extension/WallabagExtension.php
index 0b004a30..92406865 100644
--- a/src/Wallabag/CoreBundle/Twig/Extension/WallabagExtension.php
+++ b/src/Wallabag/CoreBundle/Twig/Extension/WallabagExtension.php
@@ -38,4 +38,4 @@ class WallabagExtension extends \Twig_Extension
38 { 38 {
39 return 'wallabag_extension'; 39 return 'wallabag_extension';
40 } 40 }
41} \ No newline at end of file 41}