Skip to content

Instantly share code, notes, and snippets.

View zeelot's full-sized avatar

zeelot zeelot

  • Microsoft Research
  • Seattle
View GitHub Profile
@zeelot
zeelot / classes-view-page-browse.php
Created March 27, 2012 04:17
Top navigation with selected status (change dashes for slashes as gists do not allow directories)
<?php
Class View_Page_Browse extends View_Page {
// On this page, 'browse' tab is selected
protected $_selected_top_nav_item = 'browse';
}
@zeelot
zeelot / url.php
Created August 29, 2012 16:08
Fix for security issue in Kohana 3.0.8 - 3.2.1
<?php defined('SYSPATH') or die('No direct script access.');
// Just use this file in application/classes/url.php for a fix until 3.2.2 is out
class URL extends Kohana_URL {
/**
* Fetches an absolute site URL based on a URI segment.
*
* echo URL::site('foo/bar');
*
@zeelot
zeelot / Router.php.diff
Created October 13, 2012 23:23
trying to fix #4113
diff --git a/classes/Kohana/Route.php b/classes/Kohana/Route.php
index fdd2e1b..d8e33fe 100644
--- a/classes/Kohana/Route.php
+++ b/classes/Kohana/Route.php
@@ -531,8 +531,12 @@ class Kohana_Route {
return rtrim($params['host'], '/').'/'.$uri;
}
+ // Keep track of whether an optional param was replaced
+ $provided_optional = FALSE;