Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
064db25
Use basename instead of substr and strrpos
acidvertigo Aug 28, 2014
5ab54ad
Use basename instead of substr strrpos
acidvertigo Aug 28, 2014
b3c74fa
Use basename instead of substrate
acidvertigo Aug 28, 2014
18341c3
Fix typo
acidvertigo Aug 28, 2014
ace2bb0
Fix typo
acidvertigo Aug 28, 2014
83d25a2
Use basename instead of substr strrpos
acidvertigo Aug 28, 2014
8b34ad9
Use path info for file extension
acidvertigo Aug 28, 2014
7054146
Use path info for file extension
acidvertigo Aug 28, 2014
492ee95
Use path info for file extension
acidvertigo Aug 28, 2014
0e8d59b
Fix typo
acidvertigo Aug 28, 2014
4668178
Use pathinfo for file extension
acidvertigo Aug 28, 2014
8e73ea2
Fix typo
acidvertigo Aug 28, 2014
13d9c60
Fix typos
acidvertigo Aug 28, 2014
7f92779
REFIX typo
acidvertigo Aug 28, 2014
ee8a45e
Fix typo
acidvertigo Aug 28, 2014
b546079
Fix file extension check with pathinfo instead of basename
acidvertigo Aug 28, 2014
4ab5fef
Fix remove point from extension check
acidvertigo Aug 28, 2014
5e9ff30
Fix typo
acidvertigo Aug 28, 2014
f106308
Use pathinfo to get file extension instead of string operations
acidvertigo Aug 29, 2014
2917f59
Use pathinfo instead of string operations to get file extension
acidvertigo Aug 29, 2014
f3834bb
Use basename instead of substr strrpos
acidvertigo Aug 29, 2014
cd41fac
fix name variable
acidvertigo Aug 29, 2014
b381897
Fix typo
acidvertigo Aug 29, 2014
e63d080
fix typo
acidvertigo Aug 29, 2014
de5d425
fix typo
acidvertigo Aug 29, 2014
7600eff
Use pathinfo instead of strinfg operations to get file extension
acidvertigo Aug 29, 2014
3278910
Use pahtinfo instead of string functions to get the file extension
acidvertigo Aug 29, 2014
e8b736a
Merge pull request #76 from osCommerce/master
acidvertigo Sep 2, 2014
cf74694
Merge pull request #88 from osCommerce/master
acidvertigo Oct 6, 2014
d134cfc
Merge pull request #107 from osCommerce/master
acidvertigo Oct 7, 2014
4ff3751
Merge pull request #137 from osCommerce/master
acidvertigo Nov 3, 2014
29c1ae7
Merge pull request #163 from osCommerce/master
acidvertigo Nov 7, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions catalog/includes/classes/action_recorder.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ function actionRecorder($module, $user_id = null, $user_name = null) {
$module = tep_sanitize_string(str_replace(' ', '', $module));

if (defined('MODULE_ACTION_RECORDER_INSTALLED') && tep_not_null(MODULE_ACTION_RECORDER_INSTALLED)) {
if (tep_not_null($module) && in_array($module . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)), explode(';', MODULE_ACTION_RECORDER_INSTALLED))) {
if (tep_not_null($module) && in_array($module . '.' . pathinfo($PHP_SELF, PATHINFO_EXTENSION), explode(';', MODULE_ACTION_RECORDER_INSTALLED))) {
if (!class_exists($module)) {
if (file_exists(DIR_WS_MODULES . 'action_recorder/' . $module . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)))) {
include(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/action_recorder/' . $module . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)));
include(DIR_WS_MODULES . 'action_recorder/' . $module . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)));
if (file_exists(DIR_WS_MODULES . 'action_recorder/' . $module . '.' . pathinfo($PHP_SELF, PATHINFO_EXTENSION))) {
include(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/action_recorder/' . $module . '.' . pathinfo($PHP_SELF, PATHINFO_EXTENSION));
include(DIR_WS_MODULES . 'action_recorder/' . $module . '.' . pathinfo($PHP_SELF, PATHINFO_EXTENSION));
} else {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion catalog/includes/classes/email.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function find_html_images($images_dir) {

for ($i=0; $i<count($html_images); $i++) {
if ($image = $this->get_file($images_dir . $html_images[$i])) {
$content_type = $this->image_types[substr($html_images[$i], strrpos($html_images[$i], '.') + 1)];
$content_type = $this->image_types[pathinfo($html_images[$i], PATHINFO_EXTENSION)];
$this->add_html_image($image, basename($html_images[$i]), $content_type);
}
}
Expand Down
6 changes: 3 additions & 3 deletions catalog/includes/classes/order_total.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function order_total() {
include(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/order_total/' . $value);
include(DIR_WS_MODULES . 'order_total/' . $value);

$class = substr($value, 0, strrpos($value, '.'));
$class = basename($value, '.php');
$GLOBALS[$class] = new $class;
}
}
Expand All @@ -32,7 +32,7 @@ function process() {
$order_total_array = array();
if (is_array($this->modules)) {
foreach($this->modules as $value) {
$class = substr($value, 0, strrpos($value, '.'));
$class = basename($value, '.php');
if ($GLOBALS[$class]->enabled) {
$GLOBALS[$class]->output = array();
$GLOBALS[$class]->process();
Expand All @@ -57,7 +57,7 @@ function output() {
$output_string = '';
if (is_array($this->modules)) {
foreach($this->modules as $value) {
$class = substr($value, 0, strrpos($value, '.'));
$class = basename($value, '.php');
if ($GLOBALS[$class]->enabled) {
$size = sizeof($GLOBALS[$class]->output);
for ($i=0; $i<$size; $i++) {
Expand Down
2 changes: 1 addition & 1 deletion catalog/includes/classes/payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function payment($module = '') {

$include_modules = array();

if ( (tep_not_null($module)) && (in_array($module . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)), $this->modules)) ) {
if ( (tep_not_null($module)) && (in_array($module . '.' . pathinfo($PHP_SELF, PATHINFO_EXTENSION), $this->modules))) {
$this->selected_module = $module;

$include_modules[] = array('class' => $module, 'file' => $module . '.php');
Expand Down
8 changes: 4 additions & 4 deletions catalog/includes/classes/shipping.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ function shipping($module = '') {
$include_modules = array();

if ( (tep_not_null($module)) && (in_array(substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)), $this->modules)) ) {
$include_modules[] = array('class' => substr($module['id'], 0, strpos($module['id'], '_')), 'file' => substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)));
$include_modules[] = array('class' => substr($module['id'], 0, strpos($module['id'], '_')), 'file' => substr($module['id'], 0, strpos($module['id'], '_')) . '.' . pathinfo($PHP_SELF, PATHINFO_EXTENSION));
} else {
foreach ($this->modules as $value) {
$class = substr($value, 0, strrpos($value, '.'));
$class = basename($value, '.php');
$include_modules[] = array('class' => $class, 'file' => $value);
}
}
Expand Down Expand Up @@ -64,7 +64,7 @@ function quote($method = '', $module = '') {
$include_quotes = array();

foreach($this->modules as $value) {
$class = substr($value, 0, strrpos($value, '.'));
$class = basename($value, '.php');
if (tep_not_null($module)) {
if ( ($module == $class) && ($GLOBALS[$class]->enabled) ) {
$include_quotes[] = $class;
Expand All @@ -89,7 +89,7 @@ function cheapest() {
$rates = array();

foreach($this->modules as $value) {
$class = substr($value, 0, strrpos($value, '.'));
$class = basename($value, '.php');
if ($GLOBALS[$class]->enabled) {
$quotes = $GLOBALS[$class]->quotes;
for ($i=0, $n=sizeof($quotes['methods']); $i<$n; $i++) {
Expand Down
2 changes: 1 addition & 1 deletion catalog/includes/functions/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ function tep_count_modules($modules = '') {
$modules_array = explode(';', $modules);

for ($i=0, $n=sizeof($modules_array); $i<$n; $i++) {
$class = substr($modules_array[$i], 0, strrpos($modules_array[$i], '.'));
$class = basename($modules_array[$i], '.php');

if (isset($GLOBALS[$class]) && is_object($GLOBALS[$class])) {
if ($GLOBALS[$class]->enabled) {
Expand Down
2 changes: 1 addition & 1 deletion catalog/includes/modules/boxes/bm_card_acceptance.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function bm_card_acceptance_edit_logos($values, $key) {
if ( $dir = @dir(DIR_FS_CATALOG . DIR_WS_IMAGES . 'card_acceptance') ) {
while ( $file = $dir->read() ) {
if ( !is_dir(DIR_FS_CATALOG . DIR_WS_IMAGES . 'card_acceptance/' . $file) ) {
if ( in_array(substr($file, strrpos($file, '.')+1), array('gif', 'jpg', 'png')) ) {
if ( in_array(pathinfo($file, PATHINFO_EXTENSION), array('gif', 'jpg', 'png')) ) {
$files_array[] = $file;
}
}
Expand Down
4 changes: 2 additions & 2 deletions catalog/includes/modules/header_tags/ht_datepicker_jquery.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ function ht_datepicker_jquery_show_pages($text) {
function ht_datepicker_jquery_edit_pages($values, $key) {
global $PHP_SELF;

$file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
$file_extension = pathinfo($PHP_SELF, PATHINFO_EXTENSION);
$files_array = array();
if ($dir = @dir(DIR_FS_CATALOG)) {
while ($file = $dir->read()) {
if (!is_dir(DIR_FS_CATALOG . $file)) {
if (substr($file, strrpos($file, '.')) == $file_extension) {
if (pathinfo($file, PATHINFO_EXTENSION) == $file_extension) {
$files_array[] = $file;
}
}
Expand Down
4 changes: 2 additions & 2 deletions catalog/includes/modules/header_tags/ht_robot_noindex.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ function ht_robot_noindex_show_pages($text) {
function ht_robot_noindex_edit_pages($values, $key) {
global $PHP_SELF;

$file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
$file_extension = pathinfo($PHP_SELF, PATHINFO_EXTENSION);
$files_array = array();
if ($dir = @dir(DIR_FS_CATALOG)) {
while ($file = $dir->read()) {
if (!is_dir(DIR_FS_CATALOG . $file)) {
if (substr($file, strrpos($file, '.')) == $file_extension) {
if (pathinfo($PHP_SELF, PATHINFO_EXTENSION) == $file_extension) {
$files_array[] = $file;
}
}
Expand Down