Commit Graph
26 Commits
Author SHA1 Message Date
Bharat Mediratta 032e6fde5f Change MY_url::parse_url to use item::find_by_relative_url. 2010-12-21 20:47:14 -08:00
Bharat Mediratta 53a2652fd6 Create url::merge_querystring() which merges a query string into an
existing url.  Fixes #1537.
2010-12-16 20:36:00 -08:00
Bharat Mediratta bc70ff498d Use request::protocol() 2010-06-18 15:25:33 -07:00
Bharat Mediratta c3c2b45280 Update the copyright to 2010. It's only 3 months into the year :-) 2010-03-03 10:15:34 -08:00
Bharat Mediratta 86fd81ef26 Make url::merge() function use the same exact definition as url_Core::merge() 2010-01-30 17:41:48 -08:00
Bharat Mediratta 0dc184e99f Overload url::current() and url::merge() to make the current url XSS
safe.  Add tests to make sure that it doesn't relapse with future
Kohana changes.  Fixes ticket #983.

Ref: http://gallery.menalto.com/node/93738
2010-01-18 11:10:37 -08:00
Bharat Mediratta c803cb2909 Merge branch 'master' of git@github.com:gallery/gallery3 into bharat_dev 2009-12-01 19:44:29 -08:00
Bharat Mediratta 852653ef24 Clean up item routing a bit.
1) The new default route is "albums", and Albums_Controller::index() does the right thing
2) Items_Controller redirects to the appropriate specific controller
3) All item controllers now have show() instead of _show(), so that
   the routing code in url::parse_url() can get to it.  But that code is protected against
   receiving bogus requests.
2009-11-30 13:57:50 -08:00
Bharat Mediratta 1fd0e14359 Convert all DB where() calls to take 3 arguments.
Convert all open_paren() calls to and_open() or or_open() as appropriate.
2009-11-26 12:09:04 -08:00
Bharat Mediratta 2e420522ec Preliminary work to cut over to Kohana 2.4
- Kohana::log() -> Kohana_Log::add()
- Kohana::config_XXX -> Kohana_Config::instance()->XXX
- Implement View::set_global in MY_View
- Updated Cache_Database_Driver to latest APIs
- ORM::$loaded -> ORM::loaded()
- Updated item::viewable() to use K2.4 parenthesization
2009-11-25 13:22:24 -08:00
Bharat Mediratta 2aad580f53 Move specialized (pretty) url generation back into Item_Model so that
we're not relying on overriding url::site() to do tricks around item
urls.  This means that you won't get item urls by doing
url::site("albums/37"), for example, but it also means that we won't
get pretty urls where we don't expect them (like in the action of a
<form> element).

Incidentally, this will help us move over to using the slug format
because if you've got a bad character in a url, the edit forms will
now work on it since they'll be id based.
2009-09-08 13:44:52 -07:00
Bharat Mediratta 6084848088 Improve comment. 2009-09-08 10:20:06 -07:00
Bharat Mediratta 714a82d1e0 Automagically generate pretty urls for movies, too. 2009-09-07 21:49:19 -07:00
Bharat Mediratta 7889ae1085 Fix a bug where we were not properly decoding the path in the fallback
code in get_item_from_uri() by using relative_url() instead of
relative_path().
2009-09-07 21:33:00 -07:00
Bharat Mediratta a73b5e8226 Switch to using Item_Model::relative_url() for the url path. 2009-09-07 20:59:42 -07:00
Andy Staudacher b4b638be44 Undo url helper changes - url methods no longer return a SafeString.
Adding SafeString::of_safe_html() calls where urls are passed as parameters to t() and t2().
2009-08-29 16:28:30 -07:00
Andy Staudacher a10063ff68 Add more factory methods for convenience:
SafeString::purify() and SafeString::of_safe_html().

Removing SafeString::mark_html_safe() since it's no longer needed.
2009-08-29 12:34:09 -07:00
Andy Staudacher 1d633457c4 Have url::site() and other methods return a SafeString, just as t() and t2().
Benefits:
 - url::site() is often used in views and we can ensure in the url class that returned strings are indeed safe for use in HTML. Makes the list of vars of unknown safety status shorter.
 - url::site() is often used as message parameter to t() and t2(). The parameter would be HTML-escaped if it wasn't marked as safe HTML already. Makes the usage simpler / shorter.
2009-08-29 11:31:00 -07:00
Bharat Mediratta 7347d1e50d Use ENT_QUOTEs when decoding the $current_uri otherwise apostrophes
are treated as &#039; which doesn't match in our relative_path_cache.
2009-06-24 21:34:07 -07:00
Tim Almdal 8189c1fc6b Removed extra whitespace
Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
2009-06-09 21:45:57 +08:00
Tim Almdal f0ea6d532c Create a new method in MY_url.php "get_item_from_uri" which loads the item
based on the uri.  Then use this helper method in logout.php to insure that
the guest user has access to the "continue" uri.  If they don't redirect to
the root album and let it deal with access issues.

Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
2009-06-09 21:45:43 +08:00
Bharat Mediratta 12ef4272ae Work around a problem with the CGI sapi on urls that don't contain
index.php (ie, /gallery3 instead of /gallery3/index.php) that causes
is to mis-route.
2009-06-04 18:40:38 -07:00
Bharat Mediratta e5a0104769 Make sure the item is loaded in parse_url() before we use it. 2009-06-04 18:19:49 -07:00
Bharat Mediratta ce285b8feb Use the relative_path_cache to look up items which should be a faster
query than using the level + the components.
2009-05-29 21:23:08 -07:00
Bharat Mediratta 5e7cc75a29 Convert a few more references of APPPATH to MODPATH/gallery 2009-05-27 16:29:33 -07:00
Bharat Mediratta 28b41056e3 Restructure things so that the application is now just another module.
Kohana makes this type of transition fairly straightforward in that
all controllers/helpers/etc are still located in the cascading
filesystem without any extra effort, except that I've temporarily
added a hack to force modules/gallery into the module path.

Rename what's left of "core" to be "application" so that it conforms
more closely to the Kohana standard (basically, just
application/config/config.php which is the minimal thing that you need
in the application directory)

There's still considerable work left to be done here.
2009-05-27 15:07:27 -07:00