当前位置: 首页>>代码示例>>PHP>>正文


PHP JCckDev::toSafeSTRING方法代码示例

本文整理汇总了PHP中JCckDev::toSafeSTRING方法的典型用法代码示例。如果您正苦于以下问题:PHP JCckDev::toSafeSTRING方法的具体用法?PHP JCckDev::toSafeSTRING怎么用?PHP JCckDev::toSafeSTRING使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JCckDev的用法示例。


在下文中一共展示了JCckDev::toSafeSTRING方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: check

 public function check()
 {
     $this->title = trim($this->title);
     if (empty($this->title)) {
         return false;
     }
     if (empty($this->name)) {
         $this->name = $this->title;
         $this->name = JCckDev::toSafeSTRING($this->name);
         if (trim(str_replace('_', '', $this->name)) == '') {
             $datenow = JFactory::getDate();
             $this->name = $datenow->format('Y_m_d_H_i_s');
         }
     }
     return true;
 }
开发者ID:codigoaberto,项目名称:SEBLOD,代码行数:16,代码来源:search.php

示例2: onCCK_FieldPrepareStore


//.........这里部分代码省略.........
                     $user_folder = '';
                 }
                 $content_folder = $options2['path_content'] ? $config['pk'] . '/' : '';
                 for ($i = 1; $i < 11; $i++) {
                     if (JFile::exists(JPATH_SITE . '/' . $options2['path'] . $user_folder . $content_folder . '_thumb' . $i . '/' . $title)) {
                         JFile::delete(JPATH_SITE . '/' . $options2['path'] . $user_folder . $content_folder . '_thumb' . $i . '/' . $title);
                     }
                 }
                 if (JFile::exists(JPATH_SITE . '/' . $options2['path'] . $user_folder . $content_folder . $title)) {
                     JFile::delete(JPATH_SITE . '/' . $options2['path'] . $user_folder . $content_folder . $title);
                 }
             }
             $itemPath = '';
         }
     }
     $file_path = '';
     $process = false;
     switch (@$options2['size_unit']) {
         case '0':
             $unit_prod = 1;
             break;
         case '1':
             $unit_prod = 1000;
             break;
         case '2':
             $unit_prod = 1000000;
             break;
         default:
             $unit_prod = 1;
             break;
     }
     $maxsize = floatval($options2['max_size']) * $unit_prod;
     $filename = JFile::stripExt($userfile['name']);
     $userfile['name'] = str_replace($filename, JCckDev::toSafeSTRING($filename, JCck::getConfig_Param('media_characters', '-'), JCck::getConfig_Param('media_case', 0)), $userfile['name']);
     if (!$maxsize || $maxsize && $userfile['size'] < $maxsize) {
         if ($userfile && $userfile['name'] && $userfile['tmp_name']) {
             $ImageCustomName = $userfile['name'];
             $ImageCustomPath = '';
             if (@$options2['custom_path']) {
                 if (strrpos($imageCustomDir, '.') === false) {
                     $ImageCustomPath = $imageCustomDir == '' ? substr($itemPath, 0, strrpos($itemPath, '/') + 1) : ($imageCustomDir[strlen($imageCustomDir) - 1] == '/' ? $imageCustomDir : $imageCustomDir . '/');
                 } else {
                     $ImageCustomPath = substr($itemPath, 0, strrpos($itemPath, '/') + 1);
                 }
             }
             if (count($legal_ext)) {
                 $old_legal = strrpos($userfile['name'], '.') ? substr($userfile['name'], strrpos($userfile['name'], '.') + 1) : '';
                 $legal = $ImageCustomName == $userfile['name'] ? $old_legal : substr($ImageCustomName, strrpos($ImageCustomName, '.') + 1);
                 if ($old_legal && array_search($old_legal, $legal_ext) === false) {
                     JFactory::getApplication()->enqueueMessage($ImageCustomName . ' - ' . JText::_('COM_CCK_ERROR_LEGAL_EXTENSIONS'), 'notice');
                     $field->error = true;
                 } else {
                     if (trim($legal) != trim($old_legal)) {
                         $ImageCustomName .= '.' . trim($old_legal);
                     }
                 }
             }
             $file_path = $ImageCustomPath ? $ImageCustomPath : $options2['path'];
             $current_user = JFactory::getUser();
             $current_user_id = $current_user->id;
             if (strpos($file_path, '/' . $current_user_id . '/') === false) {
                 $file_path .= $options2['path_user'] && $current_user_id ? $current_user_id . '/' : '';
             }
             if (strpos($file_path, '/' . $config['pk'] . '/') === false) {
                 $file_path .= $options2['path_content'] && $config['pk'] > 0 ? $config['pk'] . '/' : '';
             }
开发者ID:pctechnikch,项目名称:SEBLOD,代码行数:67,代码来源:upload_image.php


注:本文中的JCckDev::toSafeSTRING方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。