Changeset 648


Ignore:
Timestamp:
Oct 25, 2018 12:35:37 AM (6 years ago)
Author:
anonymous
Message:

Update hash-bang references. Minor.

Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/1.1dev/bin/file_importer.php

    r90 r648  
    1 #!/usr/local/bin/php -q
     1#!/usr/bin/env php
    22<?php
    33/**
     
    2727            $file_text = join('', file($file));
    2828            fclose($fp);
    29            
     29
    3030            // Do something with file contents.
    3131            preg_match('/BALANCE:\s*\$([\.\d]+)/', $file_text, $amt);
     
    6868
    6969/**
    70  * Find all files in directories recursivly with a specified file extension. 
     70 * Find all files in directories recursivly with a specified file extension.
    7171 *
    7272 * @param  string $dir               the full path to the directory to scan
     
    8080{
    8181    static $output;
    82    
     82
    8383    $dir_handle = opendir($dir);
    8484    while ($dir_handle && ($file = readdir($dir_handle)) !== false) {
  • branches/1.1dev/bin/login_cleanup.cli.php

    r1 r648  
    1 #!/usr/local/bin/php -q
     1#!/usr/bin/env php
    22<?php
    33
  • branches/1.1dev/bin/module_maker/form_template.cli.php

    r289 r648  
    1 #!/usr/local/bin/php
     1#!/usr/bin/env php
    22<?php
    33/**
  • branches/1.1dev/bin/module_maker/list_template.cli.php

    r289 r648  
    1 #!/usr/local/bin/php
     1#!/usr/bin/env php
    22<?php
    33/**
  • branches/1.1dev/bin/module_maker/module.cli.php

    r185 r648  
    1 #!/usr/local/bin/php
     1#!/usr/bin/env php
    22<?php
    33/**
  • branches/1.1dev/bin/module_maker/sql.cli.php

    r90 r648  
    1 #!/usr/local/bin/php -q
     1#!/usr/bin/env php
    22<?php
    33/**
  • branches/1.1dev/bin/module_maker/validation.cli.php

    r90 r648  
    1 #!/usr/local/bin/php -q
     1#!/usr/bin/env php
    22<?php
    33/**
  • branches/1.1dev/bin/phpinfo.cli.php

    r1 r648  
    1 #!/usr/local/bin/php
     1#!/usr/bin/env php
    22<?php
    33phpinfo();
  • branches/1.1dev/lib/Upload.inc.php

    r391 r648  
    11<?php
    22/**
    3  * Upload.inc.php 
     3 * Upload.inc.php
    44 * Code by Strangecode :: www.strangecode.com :: This document contains copyrighted information
    55 */
     
    1616
    1717class Upload {
    18    
     18
    1919    // Display error messages to the user?
    2020    var $display_messages = true;
    21    
     21
    2222    // Existing files with the same name will be overwritten?
    2323    var $allow_overwriting = false;
     
    2828    // Array of files with errors.
    2929    var $errors = array();
    30    
     30
    3131    // Array of acceptable file extensions (lowercase).
    3232    var $valid_file_extensions = array('jpg', 'jpeg', 'gif', 'png', 'pdf', 'txt', 'text', 'html', 'htm');
    33    
    34     // The uploaded files will be owned by user 'apache'. Set world-read/write 
     33
     34    // The uploaded files will be owned by user 'apache'. Set world-read/write
    3535    // if the website admin needs to read/delete these files.
    3636    var $dest_file_perms = 0600;
    37    
     37
    3838    // Array of file extensions and corresponding mime-types.
    3939    var $mime_extension_map = array(
     
    221221    {
    222222        $path = realpath($path);
    223        
     223
    224224        if (!is_dir($path)) {
    225225            logMsg(sprintf('Upload directory invalid: %s', $path), LOG_ERR, __FILE__, __LINE__);
     
    228228            logMsg(sprintf('Upload directory not writable: %s', $path), LOG_ERR, __FILE__, __LINE__);
    229229        }
    230        
     230
    231231        // Set the default upload path, stripping any extra slashes if needed.
    232232        $this->upload_directory_path = preg_replace('!/+$!', '', $path);
     
    246246            return false;
    247247        }
    248        
     248
    249249        if (!isset($_FILES[$form_name])) {
    250250            logMsg(sprintf(_("Form element %s not posted."), $form_name), LOG_ERR, __FILE__, __LINE__);
     
    254254            return false;
    255255        }
    256        
     256
    257257        if (is_array($_FILES[$form_name]['name'])) {
    258258            $files = $_FILES[$form_name];
     
    269269
    270270        // To keep this script running even if user tries to stop browser.
    271         ignore_user_abort(true); 
    272         if (!ini_get('safe_mode')) { 
    273             set_time_limit(300); 
     271        ignore_user_abort(true);
     272        if (!ini_get('safe_mode')) {
     273            set_time_limit(300);
    274274        }
    275275
     
    284284                continue;
    285285            }
    286            
     286
    287287            // Check The php upload error messages.
    288288            if (UPLOAD_ERR_INI_SIZE === $files['error'][$i]) {
     
    326326                continue;
    327327            }
    328            
     328
    329329            // Check to be sure it's an uploaded file.
    330330            if (!is_uploaded_file($files['tmp_name'][$i])) {
     
    336336                continue;
    337337            }
    338            
     338
    339339            // Check to be sure the file is not empty.
    340340            if ($files['size'][$i] < 1) {
     
    346346                continue;
    347347            }
    348            
     348
    349349            // Check to be sure the file has a valid file extension.
    350350            if (!in_array(strtolower($this->getFilenameExtension($files['name'][$i])), $this->valid_file_extensions)) {
     
    356356                continue;
    357357            }
    358            
     358
    359359            // Check to be sure the file has a unique file name.
    360360            if (!$this->allow_overwriting && $this->exists($files['name'][$i])) {
     
    366366                continue;
    367367            }
    368            
     368
    369369            // Determine file name.
    370370            if ($num == 1) {
     
    413413            // Clean the file name of bad characters.
    414414            $file_name = $this->cleanFileName($file_name);
    415            
     415
    416416            // If the file name has no extension, use the mime-type extension.
    417417            if (!preg_match('/\.[^.]{1,5}$/', $file_name) && function_exists('mime_content_type')) {
     
    420420                }
    421421            }
    422            
     422
    423423            // Set the path and file name.
    424424            $file_path_name = $this->upload_directory_path . '/' . $file_name;
    425            
     425
    426426            // Move the file to the final place.
    427427            if (move_uploaded_file($files['tmp_name'][$i], $file_path_name)) {
     
    456456        return (sizeof($new_file_names) > 0) ? $new_file_names : false;
    457457    }
    458    
     458
    459459    /**
    460460     *
     
    467467            return false;
    468468        }
    469        
     469
    470470        $file_path_name = $this->upload_directory_path . '/' . $file_name;
    471471
     
    483483        }
    484484    }
    485    
     485
    486486    /**
    487487     *
     
    494494            return false;
    495495        }
    496        
     496
    497497        $old_file_path_name = $this->upload_directory_path . '/' . $old_name;
    498498        $new_file_path_name = $this->upload_directory_path . '/' . $new_name;
     
    513513        }
    514514    }
    515    
     515
    516516    /**
    517517     *
     
    524524            return false;
    525525        }
    526        
     526
    527527        return file_exists($this->upload_directory_path . '/' . $file_name);
    528528    }
  • trunk/lib/ImageThumb.inc.php

    r626 r648  
    2929 */
    3030
    31 // Image proprtion options.
     31// Image proportion options.
    3232define('IMAGETHUMB_FIT_WIDTH', 1);
    3333define('IMAGETHUMB_FIT_HEIGHT', 2);
     
    125125            // Enforce valid source_dir parameter.
    126126            if (isset($params['source_dir'])) {
    127                 $params['source_dir'] = realpath($params['source_dir']);
    128127                // Source must be directory.
    129128                if (!is_dir($params['source_dir'])) {
Note: See TracChangeset for help on using the changeset viewer.