Commit Graph
25 Commits
Author SHA1 Message Date
Sean McGivern 1cda245cc4 Forbid scripting for wiki files
Wiki files (not pages - files in the repo) are just sent to the browser
with whatever content-type the mime_types gem assigns to them based on
their extension. As this is from the same domain as the GitLab
application, this is an XSS vulnerability.

Set a CSP forbidding all sources for scripting, CSS, XHR, etc. on these
files.
2016-06-14 11:28:58 +01:00
Timothy Andrew e6b1d1669b Hook up the updated WikiLinkFilter to the wiki controllers.
- Need to pass in a `page_slug` to the filter, so it can rewrite based
  on the current page (all links are rewritten to the level of the app root).
- The earlier `markdown_preview` endpoint was at the level of the wiki.
  We need to know the current page (for rewriting, as above), so this
  commit moves the endpoint to the level of a wiki page.
- Fix all tests
2016-06-09 10:15:01 +05:30
Yorick Peterse 86166d2802 Split Markdown rendering & reference gathering
This splits the Markdown rendering and reference extraction phases into
two distinct code bases. The reference extraction phase no longer relies
on the html-pipeline Gem (and any related code) and allows for
extracting of references from multiple HTML nodes in a single pass. This
means that if you want to extract user references from 200 comments you
no longer need to run 200 times N number of queries, instead only a
handful of queries may be needed.
2016-05-26 17:14:00 +02:00
Rémy CoutableandStan Hu 3811eb0ba1 Fix error when trying to create a wiki page
Closes #15527.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-04-29 06:50:18 -07:00
Sebastian Klier 559ef41d32 improve check if wiki page is persisted 2016-04-20 08:25:41 +08:00
Sebastian Klier dac548b320 remove unnecessary methods 2016-04-20 08:25:40 +08:00
Sebastian Klier 54661d3d44 add slack notifications for wiki pages
update changelog
2016-04-20 08:25:40 +08:00
Gabriel Mazetto b69f8a62b2 Add specific markdown_preview route for Wikis 2016-03-30 15:04:58 -03:00
Robert Speicher 085538c2bd Use the configured Kaminari "per page" default 2016-03-19 17:37:54 -04:00
Guilherme Garnier 2b075f16c7 Fix rubocop warnings in app 2015-10-03 00:56:37 -05:00
Stan Hu fbb891c8f3 Fix broken Wiki Page History
Closes #2104

Closes #1751

Closes #1592

Closes https://github.com/gitlabhq/gitlabhq/issues/9399
2015-09-01 23:29:27 -07:00
Dmitriy Zaporozhets d63371ad78 Update controller filters
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-26 16:44:21 +02:00
Dmitriy Zaporozhets 342d553709 Rename abilities to correspond contoller/model action names
write_ was renamed to create_
modify_  was renamed to update_

So now in update action we have next code

def create
  can?(current_user, :create_issue, @issue)
end

def update
  can?(current_user, :update_issue, @issue)
end

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-26 15:55:56 +02:00
Jeroen van Baarsen 5a4ebfb47a Fixed the Rails/ActionFilter cop
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-04-20 15:39:37 +02:00
Stan Hu 3143edfea6 Fix bug where Wiki pages that include a '/' were no longer accessible
Closes #1363
2015-04-07 09:10:11 -07:00
Dmitriy Zaporozhets f0cbbd70bb Use same constant for amount of items per page 2015-03-12 15:37:00 -07:00
Dmitriy Zaporozhets 16e899ca8b Add brakeman rake task and improve code security 2015-03-02 18:11:50 -08:00
Vinnie Okada 76aad9b76e Upgrade to Rails 4.1.9
Make the following changes to deal with new behavior in Rails 4.1.2:

* Use nested resources to avoid slashes in arguments to path helpers.
2015-02-14 11:09:23 -07:00
Dmitriy Zaporozhets 61cc6a9244 Rubocop: indentation fixes Yay!!! 2015-02-02 21:59:28 -08:00
Loic Nageleisen c1ccc3a57b Added ability to serve files in wiki repository
From #6168.
2014-06-07 11:14:33 +02:00
Marin Jankovski 4146e885dd Fix styling issues. 2014-05-05 11:55:49 +02:00
Marin Jankovski 0050c07fdd Serve a file if in wiki. 2014-04-24 15:00:18 +02:00
Marin Jankovski 872482678b Speed up loading and add pagination to wiki pages page. 2014-04-11 10:02:52 +02:00
Dmitriy Zaporozhets b27c42be87 Rename wiki variables
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-04-09 14:35:01 +03:00
Dmitriy Zaporozhets 2ed7cbfba4 Move projects controllers/views in Projects module 2013-06-23 19:47:22 +03:00