mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-23 09:31:04 +00:00
commit
4fcb7eaf13
22 changed files with 73 additions and 74 deletions
|
@ -2,7 +2,6 @@
|
|||
|
||||
use Symfony\Component\HttpKernel\Kernel;
|
||||
use Symfony\Component\Config\Loader\LoaderInterface;
|
||||
use Wallabag\ApiBundle\WallabagApiBundle;
|
||||
|
||||
class AppKernel extends Kernel
|
||||
{
|
||||
|
|
|
@ -84,12 +84,12 @@ class WallabagRestController extends Controller
|
|||
public function getEntriesAction(Request $request)
|
||||
{
|
||||
$isArchived = $request->query->get('archive');
|
||||
$isStarred = $request->query->get('star');
|
||||
$sort = $request->query->get('sort', 'created');
|
||||
$order = $request->query->get('order', 'desc');
|
||||
$page = (int) $request->query->get('page', 1);
|
||||
$perPage = (int) $request->query->get('perPage', 30);
|
||||
$tags = $request->query->get('tags', []);
|
||||
$isStarred = $request->query->get('star');
|
||||
$sort = $request->query->get('sort', 'created');
|
||||
$order = $request->query->get('order', 'desc');
|
||||
$page = (int) $request->query->get('page', 1);
|
||||
$perPage = (int) $request->query->get('perPage', 30);
|
||||
$tags = $request->query->get('tags', []);
|
||||
|
||||
$pager = $this
|
||||
->getDoctrine()
|
||||
|
@ -99,7 +99,7 @@ class WallabagRestController extends Controller
|
|||
$pager->setCurrentPage($page);
|
||||
$pager->setMaxPerPage($perPage);
|
||||
|
||||
$pagerfantaFactory = new PagerfantaFactory('page', 'perPage');
|
||||
$pagerfantaFactory = new PagerfantaFactory('page', 'perPage');
|
||||
$paginatedCollection = $pagerfantaFactory->createRepresentation(
|
||||
$pager,
|
||||
new Route('api_get_entries', [], $absolute = true)
|
||||
|
@ -188,9 +188,9 @@ class WallabagRestController extends Controller
|
|||
{
|
||||
$this->validateUserAccess($entry->getUser()->getId(), $this->getUser()->getId());
|
||||
|
||||
$title = $request->request->get('title');
|
||||
$title = $request->request->get('title');
|
||||
$isArchived = $request->request->get('is_archived');
|
||||
$isStarred = $request->request->get('is_starred');
|
||||
$isStarred = $request->request->get('is_starred');
|
||||
|
||||
if (!is_null($title)) {
|
||||
$entry->setTitle($title);
|
||||
|
|
|
@ -17,7 +17,7 @@ class WsseProvider implements AuthenticationProviderInterface
|
|||
public function __construct(UserProviderInterface $userProvider, $cacheDir)
|
||||
{
|
||||
$this->userProvider = $userProvider;
|
||||
$this->cacheDir = $cacheDir;
|
||||
$this->cacheDir = $cacheDir;
|
||||
|
||||
// If cache directory does not exist we create it
|
||||
if (!is_dir($this->cacheDir)) {
|
||||
|
|
|
@ -36,9 +36,9 @@ class WsseListener implements ListenerInterface
|
|||
$token = new WsseUserToken();
|
||||
$token->setUser($matches[1]);
|
||||
|
||||
$token->digest = $matches[2];
|
||||
$token->nonce = $matches[3];
|
||||
$token->created = $matches[4];
|
||||
$token->digest = $matches[2];
|
||||
$token->nonce = $matches[3];
|
||||
$token->created = $matches[4];
|
||||
|
||||
try {
|
||||
$authToken = $this->authenticationManager->authenticate($token);
|
||||
|
|
|
@ -136,9 +136,9 @@ class EntryController extends Controller
|
|||
return $this->render(
|
||||
'WallabagCoreBundle:Entry:entries.html.twig',
|
||||
array(
|
||||
'form' => $form->createView(),
|
||||
'entries' => $entries,
|
||||
'currentPage' => $page
|
||||
'form' => $form->createView(),
|
||||
'entries' => $entries,
|
||||
'currentPage' => $page,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -178,9 +178,9 @@ class EntryController extends Controller
|
|||
return $this->render(
|
||||
'WallabagCoreBundle:Entry:entries.html.twig',
|
||||
array(
|
||||
'form' => $form->createView(),
|
||||
'entries' => $entries,
|
||||
'currentPage' => $page
|
||||
'form' => $form->createView(),
|
||||
'entries' => $entries,
|
||||
'currentPage' => $page,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -220,9 +220,9 @@ class EntryController extends Controller
|
|||
return $this->render(
|
||||
'WallabagCoreBundle:Entry:entries.html.twig',
|
||||
array(
|
||||
'form' => $form->createView(),
|
||||
'entries' => $entries,
|
||||
'currentPage' => $page
|
||||
'form' => $form->createView(),
|
||||
'entries' => $entries,
|
||||
'currentPage' => $page,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -265,7 +265,7 @@ class EntryController extends Controller
|
|||
|
||||
$this->get('session')->getFlashBag()->add(
|
||||
'notice',
|
||||
'Entry ' . ($entry->isArchived() ? 'archived' : 'unarchived')
|
||||
'Entry '.($entry->isArchived() ? 'archived' : 'unarchived')
|
||||
);
|
||||
|
||||
return $this->redirect($request->headers->get('referer'));
|
||||
|
@ -290,7 +290,7 @@ class EntryController extends Controller
|
|||
|
||||
$this->get('session')->getFlashBag()->add(
|
||||
'notice',
|
||||
'Entry ' . ($entry->isStarred() ? 'starred' : 'unstarred')
|
||||
'Entry '.($entry->isStarred() ? 'starred' : 'unstarred')
|
||||
);
|
||||
|
||||
return $this->redirect($request->headers->get('referer'));
|
||||
|
|
|
@ -25,7 +25,7 @@ class SecurityController extends Controller
|
|||
return $this->render('WallabagCoreBundle:Security:login.html.twig', array(
|
||||
// last username entered by the user
|
||||
'last_username' => $session->get(SecurityContext::LAST_USERNAME),
|
||||
'error' => $error,
|
||||
'error' => $error,
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -10,13 +10,14 @@ class StaticController extends Controller
|
|||
/**
|
||||
* @Route("/howto", name="howto")
|
||||
*/
|
||||
public function howtoAction()
|
||||
{
|
||||
return $this->render(
|
||||
'WallabagCoreBundle:Static:howto.html.twig',
|
||||
array()
|
||||
);
|
||||
}
|
||||
public function howtoAction()
|
||||
{
|
||||
return $this->render(
|
||||
'WallabagCoreBundle:Static:howto.html.twig',
|
||||
array()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/about", name="about")
|
||||
*/
|
||||
|
|
|
@ -23,9 +23,8 @@ class TagController extends Controller
|
|||
return $this->render(
|
||||
'WallabagCoreBundle:Tag:tags.html.twig',
|
||||
array(
|
||||
'tags' => $tags
|
||||
'tags' => $tags,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Entity\Config;
|
|||
class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function load(ObjectManager $manager)
|
||||
{
|
||||
|
@ -36,7 +36,7 @@ class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getOrder()
|
||||
{
|
||||
|
|
|
@ -11,7 +11,7 @@ use Wallabag\CoreBundle\Entity\Tag;
|
|||
class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function load(ObjectManager $manager)
|
||||
{
|
||||
|
@ -91,7 +91,7 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getOrder()
|
||||
{
|
||||
|
|
|
@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Entity\User;
|
|||
class LoadUserData extends AbstractFixture implements OrderedFixtureInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function load(ObjectManager $manager)
|
||||
{
|
||||
|
@ -38,7 +38,7 @@ class LoadUserData extends AbstractFixture implements OrderedFixtureInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getOrder()
|
||||
{
|
||||
|
|
|
@ -48,7 +48,7 @@ class Tag
|
|||
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->user = $user;
|
||||
$this->entries = new ArrayCollection();
|
||||
}
|
||||
|
||||
|
|
|
@ -123,9 +123,9 @@ class User implements AdvancedUserInterface, \Serializable
|
|||
public function __construct()
|
||||
{
|
||||
$this->isActive = true;
|
||||
$this->salt = md5(uniqid(null, true));
|
||||
$this->entries = new ArrayCollection();
|
||||
$this->tags = new ArrayCollection();
|
||||
$this->salt = md5(uniqid(null, true));
|
||||
$this->entries = new ArrayCollection();
|
||||
$this->tags = new ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -176,7 +176,7 @@ class User implements AdvancedUserInterface, \Serializable
|
|||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getSalt()
|
||||
{
|
||||
|
@ -184,7 +184,7 @@ class User implements AdvancedUserInterface, \Serializable
|
|||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getRoles()
|
||||
{
|
||||
|
@ -323,7 +323,7 @@ class User implements AdvancedUserInterface, \Serializable
|
|||
return $this->tags;
|
||||
}
|
||||
/**
|
||||
* @inheritDoc
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function eraseCredentials()
|
||||
{
|
||||
|
|
|
@ -5,7 +5,6 @@ namespace Wallabag\CoreBundle\Filter;
|
|||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Lexik\Bundle\FormFilterBundle\Filter\FilterOperands;
|
||||
use Lexik\Bundle\FormFilterBundle\Filter\Query\QueryInterface;
|
||||
|
||||
class EntryFilterType extends AbstractType
|
||||
|
@ -17,26 +16,29 @@ class EntryFilterType extends AbstractType
|
|||
->add('createdAt', 'filter_date_range', array(
|
||||
'left_date_options' => array(
|
||||
'attr' => array(
|
||||
'placeholder' => 'dd/mm/yyyy'),
|
||||
'placeholder' => 'dd/mm/yyyy',
|
||||
),
|
||||
'format' => 'dd/MM/yyyy',
|
||||
'widget' => 'single_text'
|
||||
'widget' => 'single_text',
|
||||
),
|
||||
'right_date_options' => array(
|
||||
'attr' => array(
|
||||
'placeholder' => 'dd/mm/yyyy'),
|
||||
'placeholder' => 'dd/mm/yyyy',
|
||||
),
|
||||
'format' => 'dd/MM/yyyy',
|
||||
'widget' => 'single_text'
|
||||
)))
|
||||
'widget' => 'single_text',
|
||||
),
|
||||
))
|
||||
->add('domainName', 'filter_text', array(
|
||||
'apply_filter' => function (QueryInterface $filterQuery, $field, $values)
|
||||
{
|
||||
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
|
||||
$value = $values['value'];
|
||||
if (strlen($value) <= 3 || empty($value)) {
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
$expression = $filterQuery->getExpr()->like($field, $filterQuery->getExpr()->literal('%'.$value.'%'));
|
||||
|
||||
return $filterQuery->createCondition($expression);
|
||||
}
|
||||
},
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -48,8 +50,8 @@ class EntryFilterType extends AbstractType
|
|||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
'csrf_protection' => false,
|
||||
'validation_groups' => array('filtering')
|
||||
'csrf_protection' => false,
|
||||
'validation_groups' => array('filtering'),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ class ChangePasswordType extends AbstractType
|
|||
'type' => 'password',
|
||||
'invalid_message' => 'The password fields must match.',
|
||||
'required' => true,
|
||||
'first_options' => array('label' => 'New password'),
|
||||
'first_options' => array('label' => 'New password'),
|
||||
'second_options' => array('label' => 'Repeat new password'),
|
||||
'constraints' => array(
|
||||
new Constraints\Length(array(
|
||||
|
|
|
@ -15,7 +15,7 @@ class ResetPasswordType extends AbstractType
|
|||
'type' => 'password',
|
||||
'invalid_message' => 'The password fields must match.',
|
||||
'required' => true,
|
||||
'first_options' => array('label' => 'New password'),
|
||||
'first_options' => array('label' => 'New password'),
|
||||
'second_options' => array('label' => 'Repeat new password'),
|
||||
'constraints' => array(
|
||||
new Constraints\Length(array(
|
||||
|
|
|
@ -67,7 +67,7 @@ class UsernameRssTokenConverter implements ParamConverterInterface
|
|||
public function apply(Request $request, ParamConverter $configuration)
|
||||
{
|
||||
$username = $request->attributes->get('username');
|
||||
$rssToken = $request->attributes->get('token');
|
||||
$rssToken = $request->attributes->get('token');
|
||||
|
||||
// Check, if route attributes exists
|
||||
if (null === $username || null === $rssToken) {
|
||||
|
|
|
@ -11,7 +11,7 @@ class TagRepository extends EntityRepository
|
|||
/**
|
||||
* Find Tags.
|
||||
*
|
||||
* @param int $userId
|
||||
* @param int $userId
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
|
|
@ -52,7 +52,7 @@ class WallabagPasswordEncoder extends BasePasswordEncoder
|
|||
$digest = hash($this->algorithm, $salted, true);
|
||||
|
||||
// "stretch" hash
|
||||
for ($i = 1; $i < $this->iterations; $i++) {
|
||||
for ($i = 1; $i < $this->iterations; ++$i) {
|
||||
$digest = hash($this->algorithm, $digest.$salted, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -33,8 +33,8 @@ final class Extractor
|
|||
$REAL = array();
|
||||
foreach ($GLOBALS as $key => $value) {
|
||||
if ($key != 'GLOBALS' && $key != '_SESSION' && $key != 'HTTP_SESSION_VARS') {
|
||||
$GLOBALS[$key] = array();
|
||||
$REAL[$key] = $value;
|
||||
$GLOBALS[$key] = array();
|
||||
$REAL[$key] = $value;
|
||||
}
|
||||
}
|
||||
// Saving and clearing session
|
||||
|
|
|
@ -252,7 +252,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
|||
|
||||
$data = array(
|
||||
'entry_filter[readingTime][right_number]' => 11,
|
||||
'entry_filter[readingTime][left_number]' => 11
|
||||
'entry_filter[readingTime][left_number]' => 11,
|
||||
);
|
||||
|
||||
$crawler = $client->submit($form, $data);
|
||||
|
@ -271,7 +271,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
|||
|
||||
$data = array(
|
||||
'entry_filter[createdAt][left_date]' => date('d/m/Y'),
|
||||
'entry_filter[createdAt][right_date]' => date('d/m/Y', strtotime("+1 day"))
|
||||
'entry_filter[createdAt][right_date]' => date('d/m/Y', strtotime('+1 day')),
|
||||
);
|
||||
|
||||
$crawler = $client->submit($form, $data);
|
||||
|
@ -280,13 +280,12 @@ class EntryControllerTest extends WallabagCoreTestCase
|
|||
|
||||
$data = array(
|
||||
'entry_filter[createdAt][left_date]' => '01/01/1970',
|
||||
'entry_filter[createdAt][right_date]' => '01/01/1970'
|
||||
'entry_filter[createdAt][right_date]' => '01/01/1970',
|
||||
);
|
||||
|
||||
$crawler = $client->submit($form, $data);
|
||||
|
||||
$this->assertCount(0, $crawler->filter('div[class=entry]'));
|
||||
|
||||
}
|
||||
|
||||
public function testPaginationWithFilter()
|
||||
|
@ -318,7 +317,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
|||
$crawler = $client->request('GET', '/unread/list');
|
||||
$form = $crawler->filter('button[id=submit-filter]')->form();
|
||||
$data = array(
|
||||
'entry_filter[domainName]' => 'monde'
|
||||
'entry_filter[domainName]' => 'monde',
|
||||
);
|
||||
|
||||
$crawler = $client->submit($form, $data);
|
||||
|
@ -326,7 +325,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
|||
|
||||
$form = $crawler->filter('button[id=submit-filter]')->form();
|
||||
$data = array(
|
||||
'entry_filter[domainName]' => 'wallabag'
|
||||
'entry_filter[domainName]' => 'wallabag',
|
||||
);
|
||||
|
||||
$crawler = $client->submit($form, $data);
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
namespace Wallabag\CoreBundle\Tests\Controller;
|
||||
|
||||
use Wallabag\CoreBundle\Tests\WallabagCoreTestCase;
|
||||
use Doctrine\ORM\AbstractQuery;
|
||||
|
||||
class TagControllerTest extends WallabagCoreTestCase
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue