regex and trimming updates for danbooru and lite themes
This commit is contained in:
parent
df2f90016f
commit
2859d58191
2 changed files with 6 additions and 6 deletions
|
@ -125,7 +125,7 @@ class Layout {
|
||||||
global $user;
|
global $user;
|
||||||
$username = url_escape($user->name);
|
$username = url_escape($user->name);
|
||||||
// hack
|
// hack
|
||||||
$qp = explode("/", @$_GET["q"]);
|
$qp = explode("/", ltrim(@$_GET["q"], "/"));
|
||||||
$hw = class_exists("Wiki");
|
$hw = class_exists("Wiki");
|
||||||
// php sucks
|
// php sucks
|
||||||
switch($qp[0]) {
|
switch($qp[0]) {
|
||||||
|
@ -247,10 +247,10 @@ EOD;
|
||||||
* Woo! We can actually SEE THE CURRENT PAGE!! (well... see it highlighted in the menu.)
|
* Woo! We can actually SEE THE CURRENT PAGE!! (well... see it highlighted in the menu.)
|
||||||
*/
|
*/
|
||||||
$html = null;
|
$html = null;
|
||||||
$url = $_GET['q'];
|
$url = ltrim($_GET['q'], "/");
|
||||||
|
|
||||||
$re1='.*?';
|
$re1='.*?';
|
||||||
$re2='((?:[a-z][a-z]+))';
|
$re2='((?:[a-z][a-z_]+))';
|
||||||
|
|
||||||
if ($c=preg_match_all ("/".$re1.$re2."/is", $url, $matches)) {
|
if ($c=preg_match_all ("/".$re1.$re2."/is", $url, $matches)) {
|
||||||
$url=$matches[1][0];
|
$url=$matches[1][0];
|
||||||
|
|
|
@ -80,7 +80,7 @@ class Layout {
|
||||||
global $user;
|
global $user;
|
||||||
$username = url_escape($user->name);
|
$username = url_escape($user->name);
|
||||||
// hack
|
// hack
|
||||||
$qp = explode("/", @$_GET["q"]);
|
$qp = explode("/", ltrim(@$_GET["q"], "/"));
|
||||||
$hw = class_exists("Wiki");
|
$hw = class_exists("Wiki");
|
||||||
// php sucks
|
// php sucks
|
||||||
switch($qp[0]) {
|
switch($qp[0]) {
|
||||||
|
@ -236,10 +236,10 @@ EOD;
|
||||||
* Woo! We can actually SEE THE CURRENT PAGE!! (well... see it highlighted in the menu.)
|
* Woo! We can actually SEE THE CURRENT PAGE!! (well... see it highlighted in the menu.)
|
||||||
*/
|
*/
|
||||||
$html = null;
|
$html = null;
|
||||||
$url = $_GET['q'];
|
$url = ltrim($_GET['q'], "/");
|
||||||
|
|
||||||
$re1='.*?';
|
$re1='.*?';
|
||||||
$re2='((?:[a-z][a-z]+))';
|
$re2='((?:[a-z][a-z_]+))';
|
||||||
|
|
||||||
if ($c=preg_match_all ("/".$re1.$re2."/is", $url, $matches)) {
|
if ($c=preg_match_all ("/".$re1.$re2."/is", $url, $matches)) {
|
||||||
$url=$matches[1][0];
|
$url=$matches[1][0];
|
||||||
|
|
Reference in a new issue