Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix for MediaView in CakePHP 1.3 #96

Closed
wants to merge 16 commits into from

2 participants

@CauanCabral

Small fix to handle filenames where file extensions are in UPPERCASE

@CauanCabral

Sorry, my pull request including not related changes.

@markstory
Owner

Thanks for the patch, merged in 684c377

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 6, 2010
  1. @CauanCabral
  2. @CauanCabral
Commits on Sep 8, 2010
  1. @CauanCabral
Commits on Oct 25, 2010
  1. @CauanCabral
Commits on Nov 24, 2010
  1. @CauanCabral
  2. @CauanCabral
Commits on Nov 26, 2010
  1. @CauanCabral
  2. @CauanCabral
Commits on Jan 4, 2011
  1. @CauanCabral
Commits on Jan 14, 2011
  1. @CauanCabral
Commits on Jan 26, 2011
  1. @CauanCabral
Commits on Feb 1, 2011
  1. @CauanCabral
Commits on Apr 6, 2011
  1. @CauanCabral
Commits on May 4, 2011
  1. @CauanCabral
Commits on May 27, 2011
  1. @CauanCabral
  2. @CauanCabral

    Handling files with Uppercase extesion name

    CauanCabral authored
    MediaView fixed to work correctly with file names when file extesion is UPPERCASE
This page is out of date. Refresh to see the latest.
View
4 app/config/core.php
@@ -201,12 +201,12 @@
/**
* A random string used in security hashing methods.
*/
- Configure::write('Security.salt', 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi');
+ Configure::write('Security.salt', 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0Fasdasf@#gaC9mi');
/**
* A random numeric string (digits only) used to encrypt/decrypt strings.
*/
- Configure::write('Security.cipherSeed', '76859309657453542496749683645');
+ Configure::write('Security.cipherSeed', '7685930965745354249674923123683645');
/**
* Apply timestamps with the last modified time to static assets (js, css, images).
View
6 cake/dispatcher.php
@@ -620,6 +620,12 @@ function asset($url) {
* @access protected
*/
function _deliverAsset($assetFile, $ext) {
+
+ if($ext == 'php') {
+ include($assetFile);
+ return;
+ }
+
$ob = @ini_get("zlib.output_compression") !== '1' && extension_loaded("zlib") && (strpos(env('HTTP_ACCEPT_ENCODING'), 'gzip') !== false);
$compressionEnabled = $ob && Configure::read('Asset.compress');
if ($compressionEnabled) {
View
6 cake/libs/model/datasources/dbo/dbo_postgres.php
@@ -77,7 +77,7 @@ class DboPostgres extends DboSource {
'date' => array('name' => 'date', 'format' => 'Y-m-d', 'formatter' => 'date'),
'binary' => array('name' => 'bytea'),
'boolean' => array('name' => 'boolean'),
- 'number' => array('name' => 'numeric'),
+ 'number' => array('name' => 'numeric', 'length' => '12,2'),
'inet' => array('name' => 'inet')
);
@@ -731,7 +731,7 @@ function column($real) {
}
$floats = array(
- 'float', 'float4', 'float8', 'double', 'double precision', 'decimal', 'real', 'numeric'
+ 'float', 'float4', 'float8', 'double', 'double precision', 'decimal', 'real'
);
switch (true) {
@@ -751,6 +751,8 @@ function column($real) {
return 'binary';
case (in_array($col, $floats)):
return 'float';
+ case (strpos($col, 'numeric') !== false):
+ return 'number';
default:
return 'text';
break;
View
1  cake/libs/model/datasources/dbo_source.php
@@ -743,6 +743,7 @@ function create(&$model, $fields = null, $values = null) {
$id = $values[$i];
}
}
+
$query = array(
'table' => $this->fullTableName($model),
'fields' => implode(', ', $fieldInsert),
View
4 cake/libs/view/media.php
@@ -131,7 +131,7 @@ function render() {
$this->mimeType = array_merge($this->mimeType, $mimeType);
}
- if (isset($extension) && isset($this->mimeType[$extension]) && connection_status() == 0) {
+ if (isset($extension) && isset($this->mimeType[strtolower($extension)]) && connection_status() == 0) {
$chunkSize = 8192;
$buffer = '';
$fileSize = @filesize($path);
@@ -202,7 +202,7 @@ function render() {
}
$this->_header(array(
'Last-Modified: ' . $modified,
- 'Content-Type: ' . $this->mimeType[$extension],
+ 'Content-Type: ' . $this->mimeType[strtolower($extension)],
'Content-Length: ' . $fileSize));
}
$this->_output();
Something went wrong with that request. Please try again.