Developer
  • Projects
  • Docs
  • Blog
  • Forum
  • Builds
  • BLENDER.ORG

    • Download

      Get the latest Blender, older versions, or experimental builds.

    • What's New

      Stay up-to-date with the new features in the latest Blender releases.

    LEARNING & RESOURCES

    • Blender Studio

      Access production assets and knowledge from the open movies.

    • Manual

      Documentation on the usage and features in Blender.

    DEVELOPMENT

    • Developers Blog

      Latest development updates, by Blender developers.

    • Documentation

      Guidelines, release notes and development docs.

    • Benchmark

      A platform to collect and share results of the Blender Benchmark.

    • Blender Conference

      The yearly event that brings the community together.

    DONATE

    • Development Fund

      Support core development with a monthly contribution.

    • One-time Donations

      Perform a single donation with more payment options available.

Logo
Explore
Products
Blender User Manual Developer Documentation
Blender Benchmark
Blender Studio Tools Flamenco Watchtower
Modules
Animation & Rigging Asset System Core Grease Pencil Modeling Nodes & Physics Pipeline & I/O Platforms & Builds Python API & Text Editor Sculpt, Paint & Texture Triaging User Interface VFX & Video
Rendering
Render & Cycles Viewport & EEVEE
Report a Bug Paste Code Help
Sign In
archive/phabricator
1
0
Fork 0
You've already forked phabricator
Code Issues 1 Pull Requests Packages Projects Releases Wiki Activity
Files
ef85f49adc0714e2b1acbe9368e0da9aeb8dc854
phabricator/src/applications/files/controller/PhabricatorFileShortcutController.php

21 lines
432 B
PHP
Raw Normal View History

Add /F123 shortcut Summary: I wanted to point someone on a file uploaded to Phabricator and the normal link is just too long. I guess that this also improves security. Because pointing someone to the file directly reveals the secret key used in /data/ and it can be served without auth? We already use `{F123}` so there will be no conflicts in future because we wouldn't want to reuse it for something else. I promote the link on /file/ - it adds one redirect but I think it's worth it. I also considered making the link from the File ID column but there are already too many links (with some duplicity). Test Plan: /file/ /F123 (redirect) /F9999999999 (404) Reviewers: epriestley Reviewed By: epriestley CC: aran, Koolvin Differential Revision: https://secure.phabricator.com/D2380
2012-05-03 14:46:11 -07:00
<?php
final class PhabricatorFileShortcutController
extends PhabricatorFileController {
private $id;
public function willProcessRequest(array $data) {
$this->id = $data['id'];
}
public function processRequest() {
$file = id(new PhabricatorFile())->load($this->id);
if (!$file) {
return new Aphront404Response();
}
return id(new AphrontRedirectResponse())->setURI($file->getBestURI());
}
}
Reference in New Issue Copy Permalink
Powered by Gitea Page: 61ms Template: 1ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API