Skip to content

Instantly share code, notes, and snippets.

public function generate_sitemap() {
$params = Sitemap_Params::create();
//header("Content-Type: application/xml");
$xml = new DOMDocument();
$xml->encoding = 'UTF-8';
$urlset = $xml->createElement('urlset');
$urlset->setAttribute('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9');
$urlset->setAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
function style_forms() {
var ua = $.browser;
if (!(ua.msie && ua.version.slice(0,1) == "7"))
{
$('select, input:checkbox, input:radio').livequery(function(){
$(this).uniform();
});
}
}
@EHLOVader
EHLOVader / update.php
Created February 28, 2012 01:35
Update without Authentication
<?php
$Phpr_InitOnly = true;
include 'index.php';
Core_UpdateManager::create()->cli_update();
?>
@EHLOVader
EHLOVader / config.php
Created March 5, 2012 14:37
Fix cloud ssl detection
<?
/**
* EC2's load balancer sets these for us so we know we're secure,
* preventing Magento from performing a redirect loop.
**/
if( isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https' )
{
$_SERVER['HTTPS'] = 'on';
$_SERVER['SERVER_PORT'] = 443;
}
<div id="write_review" class="clearfix">
<? if (isset($review_posted)): ?>
<p class="flash success">Your taste review has been successfully posted.</p>
<? else: ?>
<h3 id="review_link" class="clearfix"><a href="#" onclick="$('#review_form').removeClass('hidden'); $('#review_link').addClass('hidden'); return false;">Write Your Taste Review</a></h3>
<div id="review_form" class="hidden bottom_offset">
<ul class="form">
<li class="field">
<label><span class="label">Rating</span>
@EHLOVader
EHLOVader / Vuln Disclosure.md
Last active October 7, 2023 17:36
Lemonstand vulnerability report: Customer session injection/hijacking

Security Vulnerability Disclosure Report

Session injection/hijacking LemonStand ecommerce platform

Originally reported by Joseph Richardson @EHLOVader on 2011-11-30 disclosure policy (RFv2.0)

WHAT

A session injection/hijacking vulnerability through cookie manipulation

AFFECTED SYSTEMS

Lemonstand specific

@EHLOVader
EHLOVader / Vuln Disclosure.md
Last active October 7, 2023 17:36
Lemonstand vulnerability report: NULL byte poisoning

Security Vulnerability Disclosure Report

Null Byte Poisoning within LemonStand ecommerce platform

Originally reported by Joseph Richardson @EHLOVader on 2011-11-07 disclosure policy (RFv2.0)

WHAT

A NULL byte poisoning in URL for both CSS and JS combination script

AFFECTED SYSTEMS

PHP < 5.3.4

@EHLOVader
EHLOVader / pre_action.php
Last active October 7, 2015 21:18 — forked from GreatPotato/gist:3225912
Set shipping method automatically in LemonStand
<?php
/**
* Default shipping during checkout
* This snippet when added to the pre_action will allow you to default shipping selection.
*
* This is mostly useful when there is only one shipping option, this allows you to skip
* the shipping step of checkout entirely, simplifying things for your customers.
*
* This has been updated to use a dynamic method of pulling the first available shipping
* option from your list of available shipping options.
@EHLOVader
EHLOVader / page_clearcache.php
Created August 23, 2012 03:15
Lemonstand Clear cache folder
<?php
if(!Phpr::$security->getUser())
{
Phpr::$response->redirect(root_url('/'));
}else
{
$cache = Phpr::$config->get('CACHING',array());
if(isset($cache['PARAMS']) && isset($cache['PARAMS']['CACHE_DIR']))
@EHLOVader
EHLOVader / gist:3706390
Created September 12, 2012 12:52 — forked from anonymous/gist:3706319
Blog File Module
<?php
class BlogFiles_Module extends Core_ModuleBase{
/**
* Creates the module information object
* @return Core_ModuleInfo
*/
protected function createModuleInfo(){
return new Core_ModuleInfo(
"Blog Files",
"Adds files to blog posts",