diff --git a/.gitignore b/.gitignore index beb165d67..da50e211e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,15 @@ .DS_Store robots.txt sitemap.xml +cache/cachefs/* +!cache/cachefs/index.php +download/* +!download/index.php +upload/* +!upload/index.php +admin-dev/autoupgrade/* +admin-dev/backups/* +!admin-dev/backups/index.php cache/smarty/cache/* !cache/smarty/cache/index.php cache/smarty/compile/* @@ -16,6 +25,7 @@ cache/tcpdf/* !cache/tcpdf/index.php config/xml/*.xml config/settings.inc.php +config/settings.old.php log/*.log img/* !img/index.php @@ -27,6 +37,10 @@ tools/smarty*/compile/*.php override/classes/*.php themes/default/cache/*.js themes/default/cache/*.css +themes/default/modules/*/*.php +!themes/default/modules/*/index.php +themes/default/lang/*.php +!themes/default/lang/index.php modules/*/translations/*.php !modules/*/translations/index.php mails/* @@ -35,4 +49,59 @@ modules/*/mails/* !modules/*/mails/en translations/* !translations/*.gzip - +modules/atos/* +modules/addshoppers +modules/alliedwallet +modules/authorizeaim +modules/autoupgrade +modules/avalaratax +modules/backwardcompatibility +modules/canadapost +modules/cloudcache +modules/ebay +modules/fedexcarrier +modules/fianetfraud +modules/fianetsceau +modules/fidbag +modules/firstdata +modules/gadwords +modules/gamification +modules/ganalytics +modules/gsitemap +modules/hipay +modules/iadvize +modules/itembase +modules/jirafe +modules/kiala +modules/kialasmall +modules/klarnaprestashop +modules/kwixo +modules/livezilla +modules/mailjet +modules/merchantware +modules/mobile_theme +modules/mondialrelay +modules/moneybookers +modules/nqgatewayneteven +modules/ogone +modules/pagseguro +modules/paypal +modules/payulatam +modules/prediggo +modules/prestafraud +modules/shipwire +modules/shoppingfeedexport +modules/shoppingfluxexport +modules/socolissimo +modules/stripejs +modules/themeinstallator +modules/tntcarrier +modules/treepodia +modules/trustedshops +modules/trustly +modules/twenga +modules/upscarrier +modules/uspscarrier +modules/wexpay +modules/yotpo +modules/zingaya diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 944062c4e..29f1cdfdc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,5 +8,5 @@ All core files you commit in your pull request must have Open Software License ( All modules files you commit in your pull request must have Academic Free License (AFL 3.0) [1]: https://help.github.com/articles/using-pull-requests -[2]: http://docs.prestashop.com/display/PS15/Coding+Standard -[3]: http://docs.prestashop.com/display/PS15/How+to+write+a+commit+message \ No newline at end of file +[2]: http://docs.prestashop.com/display/PS15/Coding+Standards +[3]: http://docs.prestashop.com/display/PS15/How+to+write+a+commit+message diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 06dcfe350..bb91f96b5 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,80 +1,140 @@ - - (d)oekia - - Alexander Otchenashev - - Benjamin PONGY - - Burhan - - Caleydon Media - - Damien Metzger - - DamienMetzger - - Damon Skelhorn - - Daniel - - David Gasperoni - - DrySs - - DrÿSs' - - François Gaillard - - Gabriel Schwardy - - Gregory Roussac - - Ha!*!*y - - Jonathan Danse - - Krystian Podemski - - Marco Cervellin - - Michel Courtade - - Milow - - Patanock - - Pierre - - PrestaEdit - - Raphaël Malié - - Rémi Gaillard - - Samy Rabih - - Sarah Lorenzini - - Shagshag - - Vincent Augagneur - - Xavier POITAU - - aFolletete - - aKorczak - - aNiassy - - adonis karavokyros - - anat - - bLeveque - - bMancone - - bumbu - - cmouleyre - - dMetzger - - dSevere - - djfm - - fBrignoli - - fSerny - - fram - - gBrunier - - gCharmes - - gPoulain - - gRoussac - - hAitmansour - - ivancasasempere - - jBreux - - jObregon - - jessylenne - - jmCollin - - kpodemski - - lBrieu - - lCherifi - - lLefevre - - mBertholino - - mDeflotte - - mMarinetti - - marcinsz101 - - montes - - nPellicari - - nezenmoins - - oleacorner - - rGaillard - - rMalie - - rMontagne - - root - - sLorenzini - - sThiebaut - - tDidierjean - - vAugagneur - - vChabot - - vKham - - vSchoener - +- adonis karavokyros +- aFolletete +- Agence CINS +- aKorczak +- Alexander Otchenashev +- anat +- Andrew +- aNiassy +- antoniofr +- AntonLejon +- Arnaud Lemercier +- Axome +- Benjamin PONGY +- BigZ +- bLeveque +- bMancone +- bumbu +- Burhan +- Cédric Mouleyre +- Caleydon Media +- cam.lafit +- Captain FLAM +- Captain-FLAM +- ccauw +- ChristopheBoucaut +- cippest +- cmouleyre +- Corentin Delcourt +- Cosmin Hutanu +- Damien Metzger +- DamienMetzger +- Damon Skelhorn +- Daniel +- David Gasperoni +- Davy Rolink +- djfm +- dMetzger +- (d)oekia +- Dragan Skrbic +- DrÿSs' +- dreammeup +- DrySs +- dSevere +- Edouard Gaulué +- emily-d +- Fabio Chelly +- fBrignoli +- fram +- François Gaillard +- fSerny +- Gabriel Schwardy +- gBrunier +- gCharmes +- gPoulain +- Grégoire Bélorgey +- Gregory Roussac +- gRoussac +- Guillaume DELOINCE +- hAitmansour +- Ha!*!*y +- indesign47 +- inem0o +- ivancasasempere +- Jérôme Nadaud +- jBreux +- jeromenadaud +- Jerome Nadaud +- jessylenne +- jmCollin +- jObregon +- Jonathan Danse +- joseantgv +- Kevin Granger +- kpodemski +- Krystian Podemski +- lBrieu +- lCherifi +- ldecoker +- lLefevre +- marcinsz101 +- Marco Cervellin +- Mats Rynge +- MatthieuB +- Maxence +- mBertholino +- mDeflotte +- Michel Courtade +- Milow +- minic studio +- misthero +- mMarinetti +- montes +- nezenmoins +- Nicolas Sorosac +- Nils-Helge Garli Hegvik +- nPellicari +- nturato +- oleacorner +- Otto Nascarella +- Patanock +- PhpMadman +- Pierre +- Piotr Kaczor +- Piotr Moćko +- PrestaEdit +- prestarocket +- pxls +- Rémi Gaillard +- Raphaël Malié +- raulgundin +- rGaillard +- Rimas Kudelis +- rMalie +- rMontagne +- root +- runningz +- Sébastien +- Sébastien Bocahu +- Samy Rabih +- Sarah Lorenzini +- Seb +- Seynaeve +- Shagshag +- sLorenzini +- soware +- Staging +- sThiebaut +- Sylvain WITMEYER +- tDidierjean +- vAugagneur +- vChabot +- Vincent Augagneur +- Vincent Schoener +- Vincent Terenti +- vinvin27 +- vKham +- vSchoener +- Xavier +- Xavier POITAU +- Yoozio diff --git a/address.php b/address.php index fcfac54af..4dbf1d223 100644 --- a/address.php +++ b/address.php @@ -34,4 +34,4 @@ require(dirname(__FILE__).'/config/config.inc.php'); Tools::displayFileAsDeprecated(); -Tools::redirect('index.php?controller=address'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently'); \ No newline at end of file +Tools::redirect('index.php?controller=address'.((count($_GET) || count($_POST)) ? '&'.http_build_query(array_merge($_GET, $_POST), '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently'); \ No newline at end of file diff --git a/addresses.php b/addresses.php index 75e3a1dfe..cda46efcf 100644 --- a/addresses.php +++ b/addresses.php @@ -34,4 +34,4 @@ require(dirname(__FILE__).'/config/config.inc.php'); Tools::displayFileAsDeprecated(); -Tools::redirect('index.php?controller=addresses'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently'); \ No newline at end of file +Tools::redirect('index.php?controller=addresses'.((count($_GET) || count($_POST)) ? '&'.http_build_query(array_merge($_GET, $_POST), '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently'); \ No newline at end of file diff --git a/admin-dev/ajaxfilemanager/ajax_file_upload.php b/admin-dev/ajaxfilemanager/ajax_file_upload.php index 309490e06..b21a39c13 100755 --- a/admin-dev/ajaxfilemanager/ajax_file_upload.php +++ b/admin-dev/ajaxfilemanager/ajax_file_upload.php @@ -60,7 +60,7 @@ $tem[$k] = $v; } - $tem['path'] = backslashToSlash($path); + $tem['path'] = addslashes(backslashToSlash($path)); $tem['type'] = "file"; $tem['size'] = transformFileSize($tem['size']); $tem['ctime'] = date(DATE_TIME_FORMAT, $tem['ctime']); @@ -73,7 +73,7 @@ $info .= sprintf(", %s:'%s'", $k, $v); } - $info .= sprintf(", url:'%s'", getFileUrl($path)); + $info .= sprintf(", url:'%s'", addslashes(getFileUrl($path))); $info .= sprintf(", tipedit:'%s'", TIP_DOC_RENAME); diff --git a/admin-dev/ajaxfilemanager/ajax_get_file_listing.php b/admin-dev/ajaxfilemanager/ajax_get_file_listing.php index 133486637..c72110344 100755 --- a/admin-dev/ajaxfilemanager/ajax_get_file_listing.php +++ b/admin-dev/ajaxfilemanager/ajax_get_file_listing.php @@ -99,9 +99,9 @@ { $v = transformFileSize($v); } - echo (($j++ > 1)?",":'') . "'" . $k . "':'" . $v . "'"; + echo (($j++ > 1)?",":'') . "'" . addslashes($k) . "':'" . addslashes($v) . "'"; } - echo (($j++ > 1)?",":'') . "'url':'" . getFileUrl($file['path']) . "'"; + echo (($j++ > 1)?",":'') . "'url':'" . addslashes(getFileUrl($file['path'])) . "'"; echo "}\n"; } echo "};\n"; diff --git a/admin-dev/ajaxfilemanager/inc/class.file.php b/admin-dev/ajaxfilemanager/inc/class.file.php index 85512eb02..d35ff7a33 100755 --- a/admin-dev/ajaxfilemanager/inc/class.file.php +++ b/admin-dev/ajaxfilemanager/inc/class.file.php @@ -33,15 +33,15 @@ $this->fileInfo['atime'] = $this->fileStat[8]; $this->fileInfo['ctime'] = $this->fileStat[10]; $this->fileInfo['mtime'] = $this->fileStat[9]; - $this->fileInfo['path'] = $path; - $this->fileInfo['name'] = basename($path); + $this->fileInfo['path'] = addslashes($path); + $this->fileInfo['name'] = addslashes(basename($path)); $this->fileInfo['is_writable'] = $this->isWritable(); $this->fileInfo['is_readable'] = $this->isReadable(); }elseif(is_dir($this->filePath)) { $this->fileStat = @stat($path); - $this->fileInfo['name'] = basename($path); - $this->fileInfo['path'] = $path; + $this->fileInfo['name'] = addslashes(basename($path)); + $this->fileInfo['path'] = addslashes($path); $this->fileInfo['atime'] = $this->fileStat[8]; $this->fileInfo['ctime'] = $this->fileStat[10]; $this->fileInfo['mtime'] = $this->fileStat[9]; diff --git a/admin-dev/drawer.php b/admin-dev/drawer.php index c52ea4547..22baa705c 100644 --- a/admin-dev/drawer.php +++ b/admin-dev/drawer.php @@ -37,7 +37,6 @@ $height = Tools::getValue('height'); $id_employee = Tools::getValue('id_employee'); $id_lang = Tools::getValue('id_lang'); - if (!isset($cookie->id_employee) || !$cookie->id_employee || $cookie->id_employee != $id_employee) die(Tools::displayError()); @@ -47,6 +46,51 @@ if (!Validate::isModuleName($module)) if (!Tools::file_exists_cache($module_path = dirname(__FILE__).'/../modules/'.$module.'/'.$module.'.php')) die(Tools::displayError()); +$shop_id = ''; +Shop::setContext(Shop::CONTEXT_ALL); +if (Context::getContext()->cookie->shopContext) +{ + $split = explode('-', Context::getContext()->cookie->shopContext); + if (count($split) == 2) + { + if ($split[0] == 'g') + { + if (Context::getContext()->employee->hasAuthOnShopGroup($split[1])) + Shop::setContext(Shop::CONTEXT_GROUP, $split[1]); + else + { + $shop_id = Context::getContext()->employee->getDefaultShopID(); + Shop::setContext(Shop::CONTEXT_SHOP, $shop_id); + } + } + else if (Shop::getShop($split[1]) && Context::getContext()->employee->hasAuthOnShop($split[1])) + { + $shop_id = $split[1]; + Shop::setContext(Shop::CONTEXT_SHOP, $shop_id); + } + else + { + $shop_id = Context::getContext()->employee->getDefaultShopID(); + Shop::setContext(Shop::CONTEXT_SHOP, $shop_id); + } + } +} + +// Check multishop context and set right context if need +if (Shop::getContext()) +{ + if (Shop::getContext() == Shop::CONTEXT_SHOP && !Shop::CONTEXT_SHOP) + Shop::setContext(Shop::CONTEXT_GROUP, Shop::getContextShopGroupID()); + if (Shop::getContext() == Shop::CONTEXT_GROUP && !Shop::CONTEXT_GROUP) + Shop::setContext(Shop::CONTEXT_ALL); +} + +// Replace existing shop if necessary +if (!$shop_id) + Context::getContext()->shop = new Shop(Configuration::get('PS_SHOP_DEFAULT')); +elseif (Context::getContext()->shop->id != $shop_id) + Context::getContext()->shop = new Shop($shop_id); + require_once($module_path); $graph = new $module(); @@ -57,4 +101,3 @@ if ($option) $graph->create($render, $type, $width, $height, $layers); $graph->draw(); - diff --git a/admin-dev/footer.inc.php b/admin-dev/footer.inc.php index 5f91c44fa..de8dc6a14 100644 --- a/admin-dev/footer.inc.php +++ b/admin-dev/footer.inc.php @@ -30,14 +30,14 @@ echo '
diff --git a/admin-dev/functions.php b/admin-dev/functions.php index d64c3e3e8..314d2b867 100644 --- a/admin-dev/functions.php +++ b/admin-dev/functions.php @@ -223,8 +223,16 @@ function checkPSVersion() return $upgrader->checkPSVersion(); } +/** + * Deprecated since > 1.5.4.1 + * Use Translate::getAdminTranslation($string) instead + * + * @param string $string + */ function translate($string) { + Tools::displayAsDeprecated(); + global $_LANGADM; if (!is_array($_LANGADM)) return str_replace('"', '"', $string); @@ -233,7 +241,6 @@ function translate($string) return str_replace('"', '"', stripslashes($str)); } - /** * Returns a new Tab object * @@ -461,7 +468,7 @@ function runAdminTab($tab, $ajaxMode = false) echo ''; if (!$ajaxMode && Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_ALL && Context::getContext()->controller->multishop_context != Shop::CONTEXT_ALL) @@ -470,10 +477,10 @@ function runAdminTab($tab, $ajaxMode = false) if (Shop::getContext() == Shop::CONTEXT_GROUP) { $shop_group = new ShopGroup((int)Shop::getContextShopGroupID()); - printf(translate('You are configuring your store for group shop %s'), ''.$shop_group->name.''); + printf(Translate::getAdminTranslation('You are configuring your store for group shop %s'), ''.$shop_group->name.''); } elseif (Shop::getContext() == Shop::CONTEXT_SHOP) - printf(translate('You are configuring your store for shop %s'), ''.Context::getContext()->shop->name.''); + printf(Translate::getAdminTranslation('You are configuring your store for shop %s'), ''.Context::getContext()->shop->name.''); echo ''; } if (Validate::isLoadedObject($adminObj)) @@ -546,8 +553,8 @@ function runAdminTab($tab, $ajaxMode = false) // we can display the correct url - // die(Tools::jsonEncode(array(translate('Invalid security token'),$url))); - die(Tools::jsonEncode(translate('Invalid security token'))); + // die(Tools::jsonEncode(array(Translate::getAdminTranslation('Invalid security token'),$url))); + die(Tools::jsonEncode(Translate::getAdminTranslation('Invalid security token'))); } else { @@ -559,17 +566,17 @@ function runAdminTab($tab, $ajaxMode = false) if (false === strpos($url, '?token=') AND false === strpos($url, '&token=')) $url .= '&token='.$adminObj->token; - $message = translate('Invalid security token'); + $message = Translate::getAdminTranslation('Invalid security token'); echo '
'.$message.'