Issue 99: Middleware needs to replace certain occurrences

This commit is contained in:
Nathan Adams 2015-01-18 22:06:57 -06:00
parent 8555a1b7f7
commit ce09cf446e
2 changed files with 3 additions and 3 deletions

View File

@ -60,8 +60,8 @@ class IDF_Middleware_GoogleAds
} }
$replacead1 = $this->makead(Pluf::f("google_ads")["AD1"]); $replacead1 = $this->makead(Pluf::f("google_ads")["AD1"]);
$replacead2 = $this->makead(Pluf::f("google_ads")["AD2"]); $replacead2 = $this->makead(Pluf::f("google_ads")["AD2"]);
$response->content = str_replace('<!--AD1-->', $replacead1, $response->content); $response->content = substr_replace($response->content, $replacead1, strrpos($response->content,'<!--AD1-->'), strlen('<!--AD1-->'));
$response->content = str_replace('<!--AD2-->', $replacead2, $response->content); $response->content = substr_replace($response->content, $replacead2, strrpos($response->content,'<!--AD2-->'), strlen('<!--AD2-->'));
return $response; return $response;
} }

View File

@ -61,7 +61,7 @@ class Pluf_Middleware_Stats
$text = "Page rendered in " . sprintf('%.5f', (microtime(true) - $GLOBALS['_PX_starttime'])) . "s using " . count($GLOBALS['_PX_debug_data']['sql_queries']) . " queries."; $text = "Page rendered in " . sprintf('%.5f', (microtime(true) - $GLOBALS['_PX_starttime'])) . "s using " . count($GLOBALS['_PX_debug_data']['sql_queries']) . " queries.";
else else
$text = "Page rendered in " . sprintf('%.5f', (microtime(true) - $GLOBALS['_PX_starttime'])) . "s."; $text = "Page rendered in " . sprintf('%.5f', (microtime(true) - $GLOBALS['_PX_starttime'])) . "s.";
$response->content = str_replace('</body>', $text.'</body>', $response->content); $response->content = substr_replace($response->content, $text.'</body>', strrpos($response->content,'</body>'), strlen('</body>'));
return $response; return $response;
} }
} }